mysql8修改密码报错: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

修改密码时使用:mysql> update user set password=password("123456") where user="root";一直报错:

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 '("123456") where user='root'
update user set password=password("123456' at line 1,经查询是因为mysql版本问题导致。

使用下面代码:mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';  修改成功了。

posted @ 2021-01-18 16:32  薰衣草的色彩  阅读(1074)  评论(0)    收藏  举报