当前位置:网站首页>Nacos program connects to mysql8 0+ NullPointerException
Nacos program connects to mysql8 0+ NullPointerException
2022-04-23 15:06:00 【JUST DO YOU LIKE】
1、 Report the wrong question :Nacos change to the use of sth. MySQL After storage , start-up Nacos Service error
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2330)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at JDBC.Demo.main(Demo.java:15)
Caused by: java.lang.NullPointerException
at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:2997)
at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1934)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1863)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
... 13 more
2、 Error reason : mysql-connector-java mysql Of Java The driver needs to be updated to 8.0+
3、 Solution
- stay Pom Change to 8.0+ Problem solvable
<!-- mysql Database driver package --> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.21</version> </dependency>
- Use a lower version , Such as 5.7+, Be careful Nacos Support 5.65 Version above MySQL
版权声明
本文为[JUST DO YOU LIKE]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231505599530.html
边栏推荐
- 分享 20 个不容错过的 ES6 的技巧
- One of the advanced applications of I / O reuse: non blocking connect -- implemented using select (or poll)
- API gateway / API gateway (III) - use of Kong - current limiting rate limiting (redis)
- 1n5408-asemi rectifier diode
- Share 3 tools, edit 5 works at home and earn more than 400
- LeetCode162-寻找峰值-二分-数组
- Little red book timestamp2 (2022 / 04 / 22)
- Resolve the conflict between computed attribute and input blur event
- C语言超全学习路线(收藏让你少走弯路)
- Application of skiplist in leveldb
猜你喜欢
Programming philosophy - automatic loading, dependency injection and control inversion
TLS / SSL protocol details (30) RSA, DHE, ecdhe and ecdh processes and differences in SSL
Sword finger offer II 019 Delete at most one character to get palindrome (simple)
Analysis of common storage types and FTP active and passive modes
Basic operation of circular queue (Experiment)
OC to swift conditional compilation, marking, macro, log, version detection, expiration prompt
Have you learned the basic operation of circular queue?
Role of asemi rectifier module mdq100-16 in intelligent switching power supply
asp. Net method of sending mail using mailmessage
Reptile exercises (1)
随机推荐
C语言超全学习路线(收藏让你少走弯路)
Pnpm installation and use
January 1, 1990 is Monday. Define the function date_ to_ Week (year, month, day), which realizes the function of returning the day of the week after inputting the year, month and day, such as date_ to
Fill in the next right node pointer II of each node [classical hierarchy traversal | regarded as linked list]
go基础 反射
分布式事务Seata介绍
SQLSERVER事物与锁的问题
How does eolink help telecommuting
1n5408-asemi rectifier diode
Set onedrive or Google drive as a drawing bed in upic for free
C language super complete learning route (collection allows you to avoid detours)
One of the advanced applications of I / O reuse: non blocking connect -- implemented using select (or poll)
Detailed explanation of C language knowledge points - data types and variables [2] - integer variables and constants [1]
Sword finger offer II 019 Delete at most one character to get palindrome (simple)
JUC learning record (2022.4.22)
nuxt项目:全局获取process.env信息
8.5 concise implementation of cyclic neural network
Leetcode exercise - 396 Rotation function
Have you learned the basic operation of circular queue?
博睿数据携手F5共同构建金融科技从代码到用户的全数据链DNA