当前位置:网站首页>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
边栏推荐
- For 22 years, you didn't know the file contained vulnerabilities?
- Reptile exercises (1)
- What is the effect of Zhongfu Jinshi wealth class 29800? Walk with professional investors to make investment easier
- TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2
- About UDP receiving ICMP port unreachable
- On the day of entry, I cried (mushroom street was laid off and fought for seven months to win the offer)
- How to write the keywords in the cover and title? As we media, why is there no video playback
- Advanced application of I / O multiplexing: Processing TCP and UDP services at the same time
- Epolloneshot event of epoll -- instance program
- C language super complete learning route (collection allows you to avoid detours)
猜你喜欢
LeetCode 练习——396. 旋转函数
Is asemi ultrafast recovery diode interchangeable with Schottky diode
Brute force of DVWA low -- > High
3、 Gradient descent solution θ
Sword finger offer II 019 Delete at most one character to get palindrome (simple)
Introduction to distributed transaction Seata
What is the role of the full connection layer?
LeetCode149-直线上最多的点数-数学-哈希表
22年了你还不知道文件包含漏洞?
Bingbing learning notes: take you step by step to realize the sequence table
随机推荐
Vscode Chinese plug-in doesn't work. Problem solving
Tun equipment principle
What is the effect of Zhongfu Jinshi wealth class 29800? Walk with professional investors to make investment easier
Detailed explanation of C language knowledge points - data types and variables [2] - integer variables and constants [1]
Async void caused the program to crash
JUC learning record (2022.4.22)
Five data types of redis
Realization of four data flow modes of grpc based on Multilingual Communication
C language super complete learning route (collection allows you to avoid detours)
C语言超全学习路线(收藏让你少走弯路)
Leetcode149 - maximum number of points on a line - Math - hash table
Tencent has written a few words, Ali has written them all for a month
Leetcode165 compare version number double pointer string
LeetCode165-比较版本号-双指针-字符串
Application of skiplist in leveldb
LeetCode153-寻找旋转排序数组中的最小值-数组-二分查找
js——实现点击复制功能
Go basic reflection
Lotus DB design and Implementation - 1 Basic Concepts
async关键字