我在尝试连接到mysql 8.0时遇到了这个错误。我该怎么解决?
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server;
consider upgrading MySQL client',
sqlState: '08004',
fatal: true
请尝试按以下方式更改密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
"password"指的是您需要更改您已有的密码或修改为一个新密码
plugin
字段,因为它被设置为“auth_socket”。use mysql; update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
请查看此链接:点击这里。 - Manavmysql> use mysql; Database changed mysql> update user set password=PASSWORD("helloworld") 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 '("helloworld") where User='root'' at line 1
- Rupesh