ITPub博客

首页 > 数据库 > MySQL > mysql新建用户不能登陆

mysql新建用户不能登陆

原创 MySQL 作者:bizhanjie 时间:2015-04-21 18:23:37 0 删除 编辑
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为空的记录,登陆正常。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29193965/viewspace-1589840/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-09-18

  • 博文量
    41
  • 访问量
    296753