自己在学习springboot的时候,搭建springboot项目,往数据库插入数据时报错,
如下:
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
网上查看是数据库时区问题,本来的数据库配置是:
spring.datasource.url=jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=true
后来添加:
serverTimezone=GMT%2B8&
重启测试,添加成功。
mysql数据库时区设置问题
最新推荐文章于 2024-07-01 20:06:23 发布