当前位置:   article > 正文

c3p0连接mysql出现错误_cannotacquireresourceex连接出错mysql

cannotacquireresourceex连接出错mysql

工具和环境

ubuntu16.0.4

idea17

mysql5.7

c3p0 0.9.5.2

mysql-connector-java

主要的报错句子:

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!

Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

Caused by: java.sql.SQLException: Access denied for user 'linyc'@'localhost' (using password: YES)

原因:

c3p0.properties配置文件中的属性名前要加c3p0

我早上用的是windows系统的idea不加c3p0前缀依然正确,但晚上用了ubuntu的idea配置c3p0配置文件时不加前缀就出问题了。

参考:https://blog.csdn.net/zhoucheng05_13/article/details/53352003

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/627481
推荐阅读
相关标签
  

闽ICP备14008679号