mysql的时区错误问题: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

报错: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

解决方法1:

show VARIABLES like '%time_zone%'

set GLOBAL time_zone="+8:00"

面对mysql的时区问题,只要将时间设置为你当前系统的时区就行。

mysql的时区错误问题: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

也可以这样操作:运行后两行命令,解决时区问题。

mysql的时区错误问题: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

方法2:

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8

spring.datasource.data-username=root

spring.datasource.data-password=123456