# / 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;
You can restart