想要解决方案的直接拉到最后
[08S01]
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.
java.io.EOFException: SSL peer shut down incorrectly.
不知什么原因
DataGrip
突然连不上某个数据库(下面称之为A库)
其他数据库经测试是正常的(排除掉软件和本机网络的问题)
然后用Navicat
连接A库又是正常的(排除掉mysql服务的问题)
最后就只好在DataGrip
本身找问题了
经过google大部分人都把问题指向了mysql
版本迭代引入的安全特性导致的
解决办法就是在数据库连接url后面加上&useSSL=false
即可
新版本的mysql
服务默认开启了SSL
For 8.0.12 and earlier: Use SSL when communicating with the server (true/false), default is ‘true’ when connecting to MySQL 5.5.45+, 5.6.26+ or 5.7.6+, otherwise default is ‘false’.[CR] For 8.0.13 and later: Default is ‘true’. DEPRECATED. See sslMode property description for details.
指定不走SSL
依旧无法连接mysql
报了个新的错误
[08001] Public Key Retrieval is not allowed
com.mysql.cj.exceptions.UnableToConnectException: Public Key Retrieval is not allowed.
此时我们需要把alowPublicKeyRetrieval
打开