1. 启动(重启)mysql:sudo /etc/init.d/mysqld restart –skip-grant-tables,使其不进行权限验证
  2. 修改root密码:
  • mysql> use mysql;
  • update user set password=PASSWORD(‘newpwd’) where user = ‘root';
  • FLUSH PRIVILEGES;
  1. 正常重启mysql:sudo /etc/init.d/mysqld restart

Leave a Reply