ssm连接mysql出现Connections could not be acquired from the underlying database 问题

ssm连接mysql出现Connections could not be acquired from the underlying database 问题

ssm连接mysql出现Connections could not be acquired from the underlying database 问题

 解决方案:

1.驱动配置有误:driver=com.mysql.jdbc.Driver

2.数据库连接地址有误:url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT

useSSL=false 有时候需要添加这个

3.密码或帐号有误:username=root password=root

4.数据库未启动或无权访问
5.mysql root没有远程访问的权限,需要增加权限,增加权限的步骤如下:
进入mysql数据库:
grant all privileges on . to 'root'@'%' identified by 'root' with grant option;
flush privileges;
6.mysql-connector-connector的jar包版本和数据库不对应造成的