GreatSQL社区

搜索

[已解决] GreatSQL 5.7.36-39 对应驱动是多少啊?

715 6 2024-3-18 21:56
本帖最后由 lixuejun0908 于 2024-3-18 21:57 编辑

哪位大佬知道:GreatSQL 5.7.36-39 的驱动是什么版本? 对应的MYSQL版本又是什么版本呢?
全部回复(6)
yejr 2024-3-19 13:47:26
和MySQL 5.7的驱动一样
lixuejun0908 2024-3-20 10:14:33
yejr 发表于 2024-3-19 13:47
和MySQL 5.7的驱动一样

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.3.10:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false
按照MYSQL5.7的连接方式,用以上方法应该可以连接greatsql5.7.36了, 但实际上不行,不知道问题在哪?
yejr 2024-3-20 10:51:55
lixuejun0908 发表于 2024-3-20 10:14
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.16 ...

可以先测试下,同样方法能连上MySQL 5.7吗?

另外,需要提供详细日志or错误信息。
lixuejun0908 2024-3-20 10:59:54
本帖最后由 lixuejun0908 于 2024-3-20 11:01 编辑
yejr 发表于 2024-3-20 10:51
可以先测试下,同样方法能连上MySQL 5.7吗?

另外,需要提供详细日志or错误信息。 ...

反复测试连上MySQL 5.7 没问题,tomcat9.0.68 错误日志如下:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.jeecms.common.configuration.ContextConfig': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.cj.mysql.jdbc.Driver
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:351)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
yejr 2024-3-20 12:52:07
lixuejun0908 发表于 2024-3-20 10:59
反复测试连上MySQL 5.7 没问题,tomcat9.0.68 错误日志如下:
Caused by: org.springframework.beans.fact ...

感觉是你选错了驱动版本,请再次确认(用ps -ef,或者lsof方式确认)和连接MySQL 5.7使用的是同一份驱动
lixuejun0908 2024-3-20 19:25:18
yejr 发表于 2024-3-20 12:52
感觉是你选错了驱动版本,请再次确认(用ps -ef,或者lsof方式确认)和连接MySQL 5.7使用的是同一份驱动 ...

ok!
lixuejun0908

2

主题

0

博客

12

贡献

新手上路

Rank: 1

积分
18

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-9-8 08:52 , Processed in 0.020888 second(s), 17 queries , Redis On.
快速回复 返回顶部 返回列表