#/etc/rc.d/init.d/mysql stop #/usr/local/mysql/bin/mysqld_safe --skip-grant-table& # /usr/local/mysql/bin/mysql -u root mysql> use mysql mysql> UPDATE user SET password=password('newpassword') WHERE user='root'; mysql> FLUSH PRIVILEGES; 重起就可以了