赞
踩
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could notacquire a resource from its primary factory or source.
可能解决该问题的办法有:
1,驱动配置有误:driver=com.mysql.jdbc.Driver
2,数据库连接地址有误:url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8
3,密码或帐号有误:username=root password=root
(上面三条一般都写在配置文件中,且一般不会写错)
4,数据库未启动或无权访问
5,项目未引入对应的数据库驱动
6,mysql root没有远程访问的权限,需要增加权限(如果是连接本地localhost数据库则不需要,连接远程数据库才需要),增加权限的步骤如下:
进入mysql数据库:
grant all privileges on . to 'root'@'%' identified by 'root' with grant option;
flush privileges;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。