通用方法:
1)service mysqld stop
2)service mysqld restart --skip-grant-tables --skip-networking
3)mysql
4)update mysql.user set password = PASSWORD(‘新密码‘) where user = ‘root‘;
5)flush privileges;
6)service mysqld stop
7)service mysqld restart
原文:http://richchen1979.blog.51cto.com/8779901/1571822