安装新版本的MySQL 后用下面的语句修改密码会提示错误
set password for root@localhost = password(‘123’);
具体错误如下:
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(‘123’)’ at line 1
这是因为新版本的修改密码的语句有点不同,需改为
alter user ‘root’@‘localhost’ identified by ‘123’;