Skip to content

Nacos use MySQL8 driver is not support MySQL8 #613

@peggypig

Description

@peggypig

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 ***

Activity

changed the title [-]nacos 集群模式启动报错[/-] [+]Nacos cluster mode startup error[/+] on Jan 11, 2019
changed the title [-]Nacos cluster mode startup error[/-] [+]Nacos 使用的 MySQL8 驱动不支持 MySQL8[/+] on Jan 11, 2019
changed the title [-]Nacos 使用的 MySQL8 驱动不支持 MySQL8[/-] [+]Nacos use MySQL8 driver is not support MySQL8[/+] on Jan 22, 2019
yanjuning

yanjuning commented on Jan 23, 2019

@yanjuning
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

naturalyui commented on Jan 23, 2019

@naturalyui

我用的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

self-assigned this
on Mar 2, 2019
TsingLiang

TsingLiang commented on Mar 20, 2019

@TsingLiang
Collaborator

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

zhuyeqing5828

zhuyeqing5828 commented on Aug 30, 2019

@zhuyeqing5828

/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

added a commit that references this issue on Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/bugCategory issues or prs related to bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @hxy1991@paderlol@zhuyeqing5828@TsingLiang@peggypig

      Issue actions

        Nacos use MySQL8 driver is not support MySQL8 · Issue #613 · alibaba/nacos