老师问个线上数据库链接问题
来源:11-13 添加拦截器上
qq_大寒_2
2019-07-31
之前一直在虚拟机本地调试,加内网转发,今天上传到阿里云报了一个错误,没找到问题,
nested exception is org.apache.ibatis.exceptions.PersistenceException: ↵### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!↵### The error may exist in file [/home/apache-tomcat-8.0.52/webapps/o2o/WEB-INF/classes/mapper/ShopDao.xml]↵### The error may involve com.imooc.o2o.dao.ShopDao.queryShopList↵### The error occurred while executing a query↵### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database
感觉是数据库链接错误,我线上数据库版本是5.6.44。。但是本地版本是mysql5.7.27(能连上)
我写了个远程链接数据库的测试类,debug也能连上,好像不是什么驱动问题,如果是驱动问题,为什么远程debug也能连上呢?
mark:之前折腾数据库版本换过mysq8.xx,c3pO驱动版本也重新配置过但是还是链接不上
1回答
-
同学好,可以尝试把c3p0版本以及mysql-connector版本替换下试试,跟我新增的那章升级mysql8对齐一下,试试
022019-08-01
相似问题