Mysql为用户设置密码

时间:2017-08-28 09:26:43

标签: mysql

当我在mysql中输入show grants for user

然后系统显示:

| GRANT USAGE ON *.* TO ''@'%' IDENTIFIED BY PASSWORD '*1E80DD016234830553A761E48526725559582391' |
| GRANT ALL PRIVILEGES ON `mydatabase`.`mytable` TO 'user'@'%'  

所以我输入了

grant all privileges on *.* to 'user'@'%' identified by 'passwd';

然后系统显示

 GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY PASSWORD '*EC75E3374932E7506AB7858A3B026E93FB8ED3DF'                                                                          
 GRANT ALL PRIVILEGES ON `mydatabase`.`mytable` TO 'user'@'%'

为什么我设置user的密码,但有两种现象:

  1. 哈希码已更改,但我的passwd密码未显示在表格中。

  2. mysql -u user它可以登录到服务器,但是mysql -u user -p然后显示拒绝访问?

0 个答案:

没有答案