无法创建可池连接工厂

2022-09-01 17:11:28

问题出在哪里?无法连接到数据库?

   org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (
            Communications link failure 
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

答案 1

这是问题的实际原因:

由以下原因引起:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

您有数据库通信链接问题。确保应用程序具有对数据库的网络访问权限(并且防火墙不会阻止到数据库的端口)。


答案 2

我在源URL中遇到了同样的问题。我用 而不是 解决 .localhost127.0.0.1localhost


推荐