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
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