控制台如下:
2019-02-12 13:36:49.588 ERROR 9928 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : init datasource error, url: jdbc:mysql://127.0.0.1:3306/demo
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property)
01S00 无效连接字符串特性
解决方法:将配置信息
spring.datasource.url = jdbc:mysql://127.0.0.1:3306/demo
添加后缀改为
spring.datasource.url = jdbc:mysql://127.0.0.1:3306/demo?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC