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';