mysql> UPDATE mysql.user SET password = password('123') 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 '('123') WHERE user = 'root'' at line 1
mySql 8.0.19
这个命令在mysql 8版本以上不起作用了,使用下面命令
alter user'root'@'localhost'identified by'newpassword';
mysql 8 set password