-
Modify my.cnf configuration sed -i '/ mysqld / a \ skip-grant-tables' /etc/my.cnf
-
Restart mysql
systemctl restart mysqld
-
Enter mysql
This time we do not need the root password
-
use mysql;
-
UPDATE user SET Password = password('newpassword') where User = 'roo
-
Refresh rights
flush privileges;
-
drop out
quit
-
Restore my.cnf configuration sed -i 's / skip-grant-tables / # skip-grant-tables / g' /etc/my.cnf
-
Mysql restart the service again
systemctl restart mysqld
-
centos skip permission to modify the password
Guess you like
Origin www.cnblogs.com/tuzaizi/p/11242033.html
Recommended
Ranking