# vim/etc/my.cnf
[mysqld]skip-grant-tables
# /etc/init.d/mysqld restartStopping MySQL: [ OK ]Starting MySQL: [ OK ]
# /usr/bin/mysqlmysql> use mysql ;mysql> update user set password=password(‘new-password‘) where User=‘root‘;mysql> flush privileges ;mysql> \qBye
# vim/etc/my.cnf
# /etc/init.d/mysqld restartStopping MySQL: [ OK ]Starting MySQL: [ OK ]
原文地址:http://hiyang.blog.51cto.com/10728919/1775779