Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
注意自己数据库使用的版本是5.7还是8.0!
我使用本地的是5.7是因为url地址后面没有加时区
修改成下面就连接成功。
url: jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false