数据库连接失败Cannot create PoolableConnectionFactory

问题:

数据库连接失败Cannot create PoolableConnectionFactory (Communications link failure

解决:

  1. 检查 url, username, password 是否有错误;
    url 一般是 “jdbc:mysql://localhost:3306/databasename”,3306 是数据库连接用的端口号,如果你用的是别的端口可以把它改掉;

  2. 把对的驱动放入项目中的 WEB-INF/lib 里,把 jar 包更新为较高的版本

你可能感兴趣的:(MySQL)