当前位置:网站首页>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
边栏推荐
- Share 3 tools, edit 5 works at home and earn more than 400
- TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2
- Comment eolink facilite le télétravail
- 填充每个节点的下一个右侧节点指针 II [经典层次遍历 | 视为链表 ]
- Nuxt project: Global get process Env information
- 分布式事务Seata介绍
- JS - implémenter la fonction de copie par clic
- When splicing HQL, the new field does not appear in the construction method
- What is the main purpose of PCIe X1 slot?
- Three uses of kprobe
猜你喜欢

冰冰学习笔记:一步一步带你实现顺序表

Introduction to Arduino for esp8266 serial port function
![Design of digital temperature monitoring and alarm system based on DS18B20 single chip microcomputer [LCD1602 display + Proteus simulation + C program + paper + key setting, etc.]](/img/c6/5241de0d670da3dae136a3047c6160.jpg)
Design of digital temperature monitoring and alarm system based on DS18B20 single chip microcomputer [LCD1602 display + Proteus simulation + C program + paper + key setting, etc.]

The win10 taskbar notification area icon is missing

Redis主从同步

Borui data and F5 jointly build the full data chain DNA of financial technology from code to user

Nuxt project: Global get process Env information

Five data types of redis

Is asemi ultrafast recovery diode interchangeable with Schottky diode

Progress in the treatment of depression
随机推荐
nuxt项目:全局获取process.env信息
Advanced application of I / O multiplexing: Processing TCP and UDP services at the same time
大文件如何快速上传?
One of the advanced applications of I / O reuse: non blocking connect -- implemented using select (or poll)
TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2
Contraction mapping theorem
Swift - literal, literal protocol, conversion between basic data types and dictionary / array
SQL中HAVING和WHERE的区别
Swift protocol Association object resource name management multithreading GCD delay once
js——实现点击复制功能
Epolloneshot event of epoll -- instance program
Set onedrive or Google drive as a drawing bed in upic for free
Llvm - generate local variables
Openfaas practice 4: template operation
UML学习_day2
TLS / SSL protocol details (30) RSA, DHE, ecdhe and ecdh processes and differences in SSL
Leetcode151 - invert words in string - String - simulation
多语言通信基础 06 go实现grpc的四种数据流模式实现
Daily question - leetcode396 - rotation function - recursion
Redis主从同步