navicat客户端能链接,代码后台连不上数据库问题

  • Post author:
  • Post category:其他


启动报错:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received 
 
No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
 
Exception in thread "main" com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

解决:


连接池

url的设置问题,加上:

?useUnicode=true

而且

useSSL=false 要设置成false