[已解决]ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables 成功解决报错
作者:mmseoamin日期:2024-04-29

概要

在mysql中创建新用户、给数据库授权用户及配置服务器IP时发生的这个报错:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement。

报错说mysql服务器正在运行不能添加,但是关闭mysql服务器重新登录时会有这个报错:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket /var/lib/mysql/mysql.sock(此报错解决方法可参考这篇文章ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket /var/lib/mysql/mysql.sock报错解决-CSDN博客)解决这个报错是要重启mysql服务,这样就会陷入死循环。

解决办法

在mysql窗口中刷新一下配置即可

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)

这时再进行用户创建和数据库授权IP操作时就会正常进行了

[已解决]ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables 成功解决报错,第1张

退出mysql,重启mysql服务

[root@localhost bin]# service mysqld restart

Redirecting to /bin/systemctl restart mysqld.service

这样就可以正常操作了。