mysql数据库新创建一用户ceshi并授权,不能登陆。
mysql> select host,user from mysql.user;
+-----------+----------------+
| host | user |
+-----------+----------------+
| % | ceshi |
| % | test@localhost |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | |
| localhost | root |
| localhost | test |
+-----------+----------------+
7 rows in set (0.00 sec)
mysql> exit
Bye
C:\Windows\system32>mysql -u ceshi -p
Enter password: *****
ERROR 1045 (28000): Access denied for user 'ceshi'@'localhost' (using password:
YES)
解决:删除user表中user为空的记录,登陆正常。
mysql> select host,user from mysql.user;
+-----------+----------------+
| host | user |
+-----------+----------------+
| % | ceshi |
| % | test@localhost |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | |
| localhost | root |
| localhost | test |
+-----------+----------------+
7 rows in set (0.00 sec)
mysql> exit
Bye
C:\Windows\system32>mysql -u ceshi -p
Enter password: *****
ERROR 1045 (28000): Access denied for user 'ceshi'@'localhost' (using password:
YES)
解决:删除user表中user为空的记录,登陆正常。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29193965/viewspace-1589840/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29193965/viewspace-1589840/