centos 安装mysql密码修改后还是不能连接的原因

时间:2021-12-23 07:20:14

centos 上安装mysql密码修改后还是不能连接出现错误:
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'

解决方法:
1.退出mysql
mysql> quit;
Bye
2、执行下面语句
[root@localhost 桌面]# mysqld_safe --skip-grant-table
3、删除空用户
 mysql -uroot  mysql
delete from user where user='';
删除后就可以了;