使用root登陆,然后执行下面的语句
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('root') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;