1. 程式人生 > 其它 >關於mysql修改密碼 set password for root@localhost = password(‘xxx‘);報錯解決方法

關於mysql修改密碼 set password for root@localhost = password(‘xxx‘);報錯解決方法

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 [email protected]
= '123456';