使用idea连接mysql数据库时显示,Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
如果你的URL中的地址(公网IP)和端口没有填错以及端口是开启的话,一般是由于公网IP所映射的服务器防火墙拒绝了你的访问导致的,
(jdbc:mysql://地址:端口?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false)
只需要在服务器的入流量添加规则就行了,如果限制IP来源的话,则需要将本机的公网IP添加进去,不然就像我一样无法访问,