用
mysqld --skip-grant-tables
来重新启动mysql,然后再修改密码
UPDATE user SET authentication_string=PASSWORD('root') where USER='root';
可能会出现的问题:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解决:
SET PASSWORD = PASSWORD('123456');