关于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 'passw
ord('123456')' at line 1
解决方法
SET PASSWORD FOR root@localhost = '123456';
mysql> SET PASSWORD FOR root@localhost = '123456';
Query OK, 0 rows affected (0.02 sec)

你可能感兴趣的:(MySQL,mysql,mysql修改密码)