1. 停止MySQL服务 service mysqld stop
  2. 修改配置文件跳过MySQL密码验证 #vim /etc/my.cnf(注:windows下修改的是my.ini)在[mysqld]后面任意一行添加“skip-grant-tables”
  3. 重启MySQL服务 service mysqld restart
  4. 登录MySQL mysql -uroot -p Enter
  5. 修改root用户密码 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123'; %代表可以远程访问
    出现The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
    解决方法:刷新mysql flush privileges重复第五步即可
Last modification:September 7th, 2020 at 01:31 pm
如果觉得我的文章对你有用,请随意赞赏