Problem description
The following error message is suddenly thrown when starting the project today:
[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
Finally, it is concluded that MySQL needs to specify whether to connect with SSL in the higher version
Solution:
Set usessl = false
, and change the connection URL as follows
jdbc:mysql://localhost:3306/test?useSSL=false
Read More:
- [Solved] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure error
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could [Solved]
- [Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
- [Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
- idea Error: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
- [Solved] init datasource error, url: xxxjava.sql.SQLRecoverableException: IO ERROR: Undefined Error
- Failed to auto-configure a DataSource: ‘spring.datasource.url‘ is not specified and no embedded data
- [Solved] Spring Boot Error: org.springframework.jdbc.datasource.embedded.EmbeddedData
- [Solved] SpringBoot Microservices: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded dat
- [Solved] Cannot find class: com.mysql.jdbc.Driver
- [Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified…bug
- [Solved] Tomcat Server Error: java.lang.NullPointerException Csonsole Error ClassNotFoundException: com.mysql.jdbc.Driver
- Extracting JDBC tool class: JDBC utils
- How to Solve JDBC connection error in spring MVC integration
- [Solved] Springboot connect MySQL error: errorcode 0, state 08s01
- [Solved] Springboot Error: Error creating bean with name ‘dataSource‘ defined in class path resource
- Java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver [How to Solve]
- [Solved] You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration proper
- [Solved] com.highgo.jdbc.util.PSQLException:bad value for long
- [Solved] Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException