mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('123456')' at line 1
通过下面的命令成功修改了密码
SET PASSWORD FOR root@localhost = '123456';