报错部分截图:
在这里插入图片描述
报错时版本:

jdk1.8   
mysql 8.0.17  
idea2018.3.6 
mysql-connector-java-5.1.37-bin.jar
1.0.9Druid

报错原因:
报错时mysql的驱动是5的,但是mysql版本是8的,不匹配

解决方案:
将mysql的驱动换成8.0.16后,
再将com.mysql.jdbc.Driver改为com.mysql.cj.jdbc.Driver,
Druid.properties配置文件的末尾添加

filters=stat
timeBetweenEvictionRunsMillis=60000
minEvictableIdleTimeMillis=300000
validationQuery=SELECT 1
testWhileIdle=true
testOnBorrow=false
testOnReturn=false
poolPreparedStatements=false
maxPoolPreparedStatementPerConnectionSize=200

问题解决。

PS:如果你有类似的问题采取上述步骤后没有解决,可以加博主qq2287015934一起交流。

GitHub 加速计划 / druid / druid
6
4
下载
阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
最近提交(Master分支:3 个月前 )
78fa7415 - Add CKDropTableStatement to handle DROP TABLE with ON CLUSTER syntax - Add parseDropTableAfterName extension point in SQLStatementParser - Implement parseDropTableAfterName in CKStatementParser for ON CLUSTER parsing - Support DEFAULT keyword as cluster name in both CREATE/DROP TABLE - Add visitor methods in CKASTVisitor and CKOutputVisitor for CKDropTableStatement - Add test cases in 6.txt for DROP TABLE and CREATE TABLE with ON CLUSTER - All 43 ClickHouse tests passing 16 天前
b94e843e 1 个月前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐