my.cnf文件末尾加上skip-grant-tables,更改完删掉
vi /etc/my.cnf
service mysql stop
service mysql start
mysql -uroot -p
update user set authentication_string=password('root') where user='root';
flush privileges;
service mysql stop
service mysql start
my.cnf文件末尾加上skip-grant-tables,更改完删掉
vi /etc/my.cnf
service mysql stop
service mysql start
mysql -uroot -p
update user set authentication_string=password('root') where user='root';
flush privileges;
service mysql stop
service mysql start