SpringBoot项目连接MYSQL的时区问题
在启动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. 原因是MYSQL时区配置不正确。
打开MYSQL的配置文件my.cnf
或者my.ini
,在[mysqld]
区块追加时区配置:
[mysqld]default-time_zone='+8:00'
然后重启MYSQL服务即可。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。