Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nacos use MySQL8 driver is not support MySQL8 #613

Closed
peggypig opened this issue Jan 11, 2019 · 4 comments
Closed

Nacos use MySQL8 driver is not support MySQL8 #613

peggypig opened this issue Jan 11, 2019 · 4 comments
Assignees
Labels
kind/bug Category issues or prs related to bug.

Comments

@peggypig
Copy link

peggypig commented Jan 11, 2019

Purpose: Start a cluster of nacos 0.7
// 目的:启动nacos 0.7的集群
Accident: Startup error, error: DumpService was not created successfully
// 意外:启动出错,报错:DumpService没有创建成功
image
image

Check the configuration file without errors
// 检查配置文件并没有错误
============================👇===================================
Replace the mysql database version, the result is successful! ! !
// 更换mysql数据库版本,结果成功!!!
Cause **The mysql driver used by nacos does not support mysql8. **
// 原因 nacos使用的mysql驱动不支持mysql8。
Can support mysql8.
// 可以对mysql8进行支持。

*** WE STRONGLY SUGGEST YOU TO DESCRIBE YOUR ISSUE IN ENGLISH ***

@nacos-bot nacos-bot changed the title nacos 集群模式启动报错 Nacos cluster mode startup error Jan 11, 2019
@nacos-bot nacos-bot added the kind/bug Category issues or prs related to bug. label Jan 11, 2019
@hxy1991 hxy1991 changed the title Nacos cluster mode startup error Nacos 使用的 MySQL8 驱动不支持 MySQL8 Jan 11, 2019
@yanlinly yanlinly changed the title Nacos 使用的 MySQL8 驱动不支持 MySQL8 Nacos use MySQL8 driver is not support MySQL8 Jan 22, 2019
@yanjuning
Copy link
Contributor

According to MySQL manual, Connector J/5.1 provides compatibility with all the functionality of MySQL 8.0, though Connector J/8.0 is the recommended version.

Connector/J version JDBC version MySQL Server version JRE Supported JDK Required for Compilation Status
8.0 4.2 5.5, 5.6, 5.7, 8.0 1.8.x 1.8.x General availability. Recommended version.
5.1 3.0, 4.0, 4.1, 4.2 5.5, 5.6*, 5.7*, 8.0* 1.5.x, 1.6.x, 1.7.x, 1.8.x* 1.5.x and 1.8.x General availability

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html

@naturalyui
Copy link

naturalyui commented Jan 23, 2019

我用的mysql8.0.14也遇到了无法连接的问题,下载了0.8.0的源码自己调试
以下是我的尝试(前提是将jdbc.url改为自己的mysql)
1、升级mysql-connector-java驱动到8.0.14,将JDBC_DRIVER_NAME改为com.mysql.cj.jdbc.Driver,提示找不到'com.mysql.cj.jdbc.Driver'
2、不修改源码,报空指针,定位到
image
原因很明了了,因为my.cnf中没有配置character_set_server属性
解决方案:
修改/etc/my.cnf配置文件,在[mysqld]下添加编码配置,如下所示:
[mysqld]
character_set_server=utf8
保存,重启mysql服务
systemctl restart mysqld
问题解决

驱动还是要升级到8.0.14,否则保存配置的时候会报PreparedStatementCallback; Could not retrieve transation read-only status server

@paderlol paderlol self-assigned this Mar 2, 2019
@TsingLiang
Copy link
Collaborator

1.0版本会支持mysql 8.X版本

@zhuyeqing5828
Copy link

zhuyeqing5828 commented Aug 30, 2019

/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Djava.ext.dirs=/usr/lib/jvm/java-1.11.0-openjdk-amd64/jre/lib/ext:/usr/lib/jvm/java-1.11.0-openjdk-amd64/lib/ext:/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/plugins/cmdb:/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/plugins/mysql -Xloggc:/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos -Dloader.path=/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/plugins/health -jar /home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/target/nacos-server.jar --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/conf/ --logging.config=/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288 -Djava.ext.dirs=/usr/lib/jvm/java-1.11.0-openjdk-amd64/jre/lib/ext:/usr/lib/jvm/java-1.11.0-openjdk-amd64/lib/ext:/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/plugins/cmdb:/home/zx/git/nacos/distribution/target/nacos-server-1.1.3/nacos/plugins/mysql is not supported. Use -classpath instead. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
the same problom use 1.1.3 source build
Ubuntu 18.04 openjdk 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

8 participants