0
点赞
收藏
分享

微信扫一扫

Could not create connection to database server.

梯梯笔记 2022-03-21 阅读 153

在使用jdbc语句时发生sql语句异常

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@170312f6 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

结果查找异常的原因,不是语句写错,依赖也导入了,但依然报错

当我换了mysql的版本号时异常解决了,原来是我的mysql的版本号过低

 成功运行并打印,mysql依赖包如下:

 <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.27</version>
        </dependency>

 (有帮助的话点个赞吧)

举报

相关推荐

SQL Server.下载安装

0 条评论