alter user ‘root‘@’localhost’identified with mysql_native_password by ‘新密码’;
这行会报错,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 'mysql_native_password by 123456' at line 1

正确如下:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
![]()
本文介绍了一种常见的MySQL用户密码设置错误,并提供了正确的语法格式。纠正了使用mysql_native_password插件进行身份验证时的常见SQL语法错误。
2841





