JDBC连接数据库时因时区报错,还有8.018连接包有cj包(com.mysql.cj.jdbc.Driver)
方法1:
连接数据库报错,在配置文件中的url后面加上?serverTimezone-UTC或?serverTimezone=GMT%2B8
方法2:打开所用的数据库
输入下面的命令:
set global time_zone=’+8:00’;
JDBC连接数据库时因时区报错,还有8.018连接包有cj包(com.mysql.cj.jdbc.Driver)
方法1:
连接数据库报错,在配置文件中的url后面加上?serverTimezone-UTC或?serverTimezone=GMT%2B8
方法2:打开所用的数据库
输入下面的命令:
set global time_zone=’+8:00’;