MySQL错误com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

我在尝试与mysql建立连接的时候抛出以下异常。
MySQL错误com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
同时问题定位出错的地方在:
conn=DriverManager.getConnection(url, user, password);
这句话中,原本的定义为:
static final String url = "jdbc:mysql://localhost:3306/wx?useSSL=true";
static final String user = "root";
static final String password = "123456";

在url处修改,修改后为useSSL=false

具体原因还不清楚,但是作为一种解决方案提供给大家。

猜你喜欢

转载自blog.csdn.net/saywhat_sayhello/article/details/79986017