/etc/init.d/mysql stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql


update user set authentication_string=password('123456') where user='root';
FLUSH PRIVILEGES;
exit;


/etc/init.d/mysql restart
mysql -uroot -p
Enter password: 123456

mysql>

 

出现上面mysql> 说明成功!

 

相关文章: