# /etc/init.d/mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql
mysql> update mysql.user set authentication_string=‘‘ where user=‘root‘;
mysql> flush privileges;
mysql> alter user ‘root‘@‘%‘ identified by ‘123‘;
mysql> quit
# service mysqld restart
# mysql -uroot -p‘123‘ 用新的密码登陆成功
原文地址:http://blog.51cto.com/13480443/2293960
时间: 2024-11-01 10:27:30