ERROR 1290 (HY000): The MySQL server is running with the –skip-grant-tables option so it cannot execute this statement

今天在安装centos7上安装mysql8,安装后发现没有生成mysqld.log文件,于是在my.cnf配置文件中加入skip-grant-tables,跳过权限验证,执行修改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY '??????';

但是报了如下错误:ERROR 1290 (HY000): The MySQL server is running with the –skip-grant-tables option so it cannot execute this statement

解决方法:在执行修改密码命令之前,需要先刷新一下权限表:

flush privileges;

311 Clicks !

发表评论

电子邮件地址不会被公开。