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

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

阅读更多
文章标签: centos mysql 连接池
个人分类: Liunx
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭