[Solved] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure error

This error was encountered during the test of integrating mybatis with springboot

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 317 milliseconds ago.  The last packet sent successfully to the server was 314 milliseconds ago.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_181]
	。。。。
	followed by a long list of

The solution is to add usessl = false to the connection string
or change usessl = true to use = false
for example

 url: jdbc:mysql://localhost:3306/sqmb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC


end!!

Read More: