项目场景:
错误代码
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.
问题描述:
错误截图:
解决方案:
1、修改程序
a.查看程序时区信息,查看url配置信息
b、修改url时区
<property name="url" value="jdbc:mysql://localhost:3306/bd_crm?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8/>
2、修改数据库
a、查看MySQL时区信息
输入:show variables like ‘%time_zone%’;
b、修改时区
1.仅修改当前会话的时区,停止会话修改就会失效
语句:set time_zone = ‘+8:00’;
2.修改全局的时区配置
语句:set global time_zone = ‘+8:00’;
flush privileges;
总结、
这是我们经常会遇到的问题,冷静下来解决就可以了!