Solution to communication link failure with error in idea startup project

Problem description

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

Solution

Option 1   Tomcat VM configuration parameters: – DJava. Net. Preferipv4stack = true

Option 2   ① Nginx configuring agent MySQL:

    ② Modify database connection: spring. Datasource. Url = JDBC: mysql://localhost:9999/demo?characterEncoding=utf8

Reference from:

https://blog.csdn.net/baidu_21349635/article/details/121032229
https://adong.blog.csdn.net/article/details/111501253

Read More: