咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

mysql报错:ERROR 1142 (42000): SELECT command denied to user \\

2023-08-16 15:46:04 902次

centos 上安装mysql密码修改后还是不能连接出现错误:

ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user' 


解决方法: 

1、退出mysql

 mysql> quit;


2、执行下面语句 

mysqld_safe --skip-grant-table

或在配置文件里添加 skip-grant-table

配置文件地址

/etc/my.cnf

 

3.查询用户

 select user,password,host from user;


4.删除空用户 

mysql -uroot mysql delete from user where user='';

 

删除后解决了问题

首页
最新活动
个人中心