init datasource error, url: jdbc: mysql://localhost:3306/test terms of settlement

dadeity 2022-01-26 12:06:20 阅读数:32

init datasource error url jdbc

Problem description

  • Today, the startup project suddenly throws the following error message :
[16:14:32.735][ERROR][com.alibaba.druid.pool.DruidDataSource][main] init datasource error, url: jdbc:mysql://localhost:3306/test
com.mysql.cj.jdbc.exceptions.CommunicationsException: 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

reason

  • Check the data and finally draw a conclusion :MySQL In the higher version, you need to indicate if you want to SSL Connect

terms of settlement

  • Set up useSSL=false, Change connection URL as follows
jdbc:mysql://localhost:3306/test?useSSL=false
copyright:author[dadeity],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201261206178228.html