vi /etc/my.cnf
添加skip-grant-tables;
sudo service mysqld restart
mysql -u root -p
update mysql.user set authentication_string='' where user='root' and host='localhost';
重新空密码登录
alter user user() identified by 'password';
quit
版权声明:本文为PeterZhuGe原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。