CentOS 7 下 部署javaweb项目时MySQL: Connections could not be acquired from the underlying database!

标签: centos mysql 连接池
4人阅读 评论(0) 收藏 举报
分类:

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

spring + springmvc 使用maven进行了打包
数据库链接池使用的是c3p0
在本地测试好好的没有任何问题 , 将javaweb项目发布到了服务器上 , MySQL却出错了
1. 查看 apache-tomcat/logs/localhost.2018-04-16.log 信息如下:

is java.sql.SQLException: Connections could not be acquired from the underlying database!] with root cause
 java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1694)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1215)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2255)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2286)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2085)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)

Connections could not be acquired from the underlying database : 无法从底层数据库获得连接
检查密码链接都是对的 , 数据库属于本地访问, 不是权限问题.

网上查了许多造成的问题可解决方法

最后在Star_Ship的文章当中描述的方法解决了我的问题


解决办法: 修改c3p0.propertise的配置文件

c3p0.blogName=
c3p0.pwd=
c3p0.driverClass=com.mysql.jdbc.Driver
c3p0.jdbcUrl=jdbc:mysql://localhost:3306/test

在每个属性的前面加上c3p0.

文章地址: https://blog.csdn.net/Array_dear/article/details/79963964

查看评论

Connections could not be acquired from the underlying database

严重: StandardWrapper.Throwableorg.springframework.transaction.CannotCreateTransactionException: Could...
  • testcs_dn
  • testcs_dn
  • 2014-12-27 16:30:46
  • 21012

解决Connections could not be acquired from the underlying database!的问题

Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database! 做...
  • qq_24949727
  • qq_24949727
  • 2016-08-07 21:08:28
  • 7901

c3p0 配置连接MySQL异常: java.sql.SQLException: Connections could not be acquired from the underlying datab

c3p0 配置连接MySQL异常:java.sql.SQLException: Connections could not be acquired from the underlying databa...
  • ailo555
  • ailo555
  • 2016-03-02 21:49:02
  • 6498

Linux磁盘空间满导致的Connections could not be acquired from the underlying database!问题

问题名称:Hibernate poperation:Cannot open connection;uncategorized SQLException for SQL[???];SQL state [...
  • litiammmm
  • litiammmm
  • 2016-11-14 16:54:42
  • 1278

spring整合mybaits时Connections could not be acquired from the underlying database!异常解决

  • liuao107329
  • liuao107329
  • 2014-12-14 11:40:00
  • 1089

解决:Connections could not be acquired from the underlying database!

问题现场如下; Caused by: java.sql.SQLException: Connections could not be acquired from the underlying data...
  • jdfkldjlkjdl
  • jdfkldjlkjdl
  • 2014-12-26 13:53:53
  • 20820

c3p0连接池连接失败:java.sql.SQLException: Connections could not be acquired from the underlying database!

问题描述:最近在使用c3p0连接池写一个小项目,在测试时始终无法正确连接数据库,报错如下:com.mchange.v2.resourcepool.BasicResourcePool$AcquireTa...
  • zhoucheng05_13
  • zhoucheng05_13
  • 2016-11-26 15:25:55
  • 1804

Connections could not be acquired from the underlying database!异常解决

解决:Connections could not be acquired from the underlying database! og4j:WARN See http://logging...
  • yeq2014
  • yeq2014
  • 2015-01-09 12:53:27
  • 567

Caused by: 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!
  • u012257551
  • u012257551
  • 2014-05-03 15:19:26
  • 1579

DB2 SQL20321N 一例

最近在做一套DB2数据库迁移时遭遇 SQL20321N报错。 场景:一套干净的环境,刚装了DB2,预计将一套老的DB2数据库迁移至此。 在源端进行冷备: db2 backup db ...
  • sunjiapeng
  • sunjiapeng
  • 2014-06-29 23:25:54
  • 1585
    个人资料
    持之以恒
    等级:
    访问量: 96
    积分: 74
    排名: 156万+
    文章分类
    文章存档