Springboot项目启动报了一下错误
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) to use a more specifc time zone value if you want to utilize time zone support.
错误大致意思为
服务器的时区无法识别或代表多个时区。如果想利用时区支持,必须配置服务器或JDBC驱动程序(通过“serverTimezone”配置属性)以使用更特殊的时区值。(有道翻译的)
解决:
在url后面添加 ?serverTimezone=UTC 即可
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/usertest?serverTimezone=UTC
username: root
password: root