网上搜修改语句:
mysql> SET PASSWORD FOR 'root' = 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
看上面提示是这个语法和数据库版本不一致
查看MySQL版本:
后面搜了:
MySQL 8 应该是:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';