使用Mysql8中的資料庫連線錯誤的解決辦法
阿新 • • 發佈:2018-11-10
錯誤日誌
這個問題的根本原因是資料庫連線池的版本過低,所以更新依賴
2018-11-10 11:06:40.441 ERROR 10575 --- [eate-2090142523] com.alibaba.druid.pool.DruidDataSource : create connection error, url: jdbc:mysql://10.211.55.28:3306/member java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:868) ~[mysql-connector-java-5.1.41.jar:5.1.41] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:864) ~[mysql-connector-java-5.1.41.jar:5.1.41] at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1746) ~[mysql-connector-java-5.1.41.jar:5.1.41] at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226) ~[mysql-connector-java-5.1.41.jar:5.1.41] at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205) ~[mysql-connector-java-5.1.41.jar:5.1.41] at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2236) ~[mysql-connector-java-5.1.41.jar:5.1.41] at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2035) ~[mysql-connector-java-5.1.41.jar:5.1.41]
更新資料庫驅動依賴
<!-- 整合mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
更新資料來源依賴
<!-- 阿里巴巴資料來源 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.12</version> </dependency>
更新完後發現啟動成功