The error message is as follows:
{timestamp: "2018-06-14t03:48:23.436+0000", Status: -, Error: "Internal Server Error",... ..}Error:"Internal Server Error "message:"Could not Open JDBC Connection for transaction; nested Exception is java.sql.SQLException: the Server Time Zone value '? d1ú±êx?ê±?? ' is Unrecognized or represents More than One Time zone. You must Configure either the Server or JDBC Driver (via the Servertimezone Configuration Property ) to Use a More specifc Time Zone value if You want to utilize Time Zone Support . "Path:"/user/userlist"Status: -timestamp:"2018-06-14t03:48:23.436+0000"
Workaround:
After spring.datasource.url
the corresponding URL, add the?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
Cases:
spring.datasource.url=jdbc:mysql://localhost:3306/zifeiydb?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
A complete example of a application.properties:
# DB Configurationspring.datasource.driverClassName=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://localhost:3306/zifeiydb?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8spring.datasource.username=rootspring.datasource.password=password# logginglogging.level.com.zifeiy.demo=debug
Spring boot connection mysql error "Internal Server error" Workaround