执行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('root')' at line 1
解决方法是修改大小写(root是你的账户),注意不要忘记末尾分号
SET PASSWORD FOR root@localhost = password('123456');