use mysql;
// 下面这句命令有点长,请注意。
update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password";
flush privileges;
quit;
mysqlを再起動します。
sudo service mysql restart
mysql -u root -p // 启动后输入已经修改好的密码:root