MySQL8.x安装后,更改密码一直提示语法错误;

安装完8.x版本的MySQL后,使用

set password for root@localhost = password('123');

修改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 'password('123456')' at line 1

这是因为新版本的修改密码的语句有点不同,使用如下语句进行修改:

alter user 'root'@'localhost' identified by  '123';

 

posted @ 2020-08-11 17:14  灵风牧师  阅读(743)  评论(0编辑  收藏  举报