在搭建maven项目测试时,报The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. 错误

解决办法:

在config.properties配置文件中对于MySQL的URL后面加上时区配置

serverTimezone=Asia/Shanghai

config.properties

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/alice?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=****

 

posted on 2019-09-06 14:03  小白coder  阅读(381)  评论(0编辑  收藏  举报