com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client jdk.internal.reflect.GeneratedConstructorAccessor15.newInstance(Unknown Source) java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) com.mysql.jdbc.Util.handleNewInstance(Util.java:411) com.mysql.jdbc.Util.getInstance(Util.java:386) com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:943) com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4113) com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1308) com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2336) com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369) com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153) com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792) com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) jdk.internal.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source) java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) com.mysql.jdbc.Util.handleNewInstance(Util.java:411) com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1375) com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1844)
时间: 2023-06-23 21:00:06 浏览: 194
MYSQL出现 Client does not support authentication 的解决方法
这个错误是因为客户端的MySQL版本不兼容服务器端的认证协议,建议升级MySQL客户端版本。在升级之前,可以尝试使用以下命令来更改认证插件:
```
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
```
其中,将 `username` 和 `password` 替换为正确的值。这会将用户的认证插件更改为 `mysql_native_password`,这可能解决这个问题。
阅读全文