Cannot create PoolableConnectionFactory (Access denied for user ''@'localhost' (using password: YES)

Cannot create PoolableConnectionFactory (Access denied for user ‘’@‘localhost’ (using password: YES))在使用dbcp连接池获取数据库连接时出现的异常解决方法

按照提示我们可以看到没有检测到用户名我们将配置文件中的url由:

url=jdbc:mysql://localhost:3306/mysqltest?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true

改为:

url=jdbc:mysql://root@localhost:3306/mysqltest?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true

这样我们再进行测试就没有问啦。

你可能感兴趣的:(Cannot create PoolableConnectionFactory (Access denied for user ''@'localhost' (using password: YES))