前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住给大家分享一下。点击跳转到网站:https://www.captainai.net/dongkelun
最近用spark和srping mybatis 连接mysql会报如下错误:1
Exception in thread "main" java.sql.SQLException: The server time zone value 'EDT' 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.
网上查了一下说是数据库和系统时区差异所造成的,我想应该是我在虚拟机上装的centos系统是英文版导致的,解决办法有如下两个:
1、修改Mysql的时区为东8区
1 | set global time_zone='+8:00' |
2、在连接数据库的url后面加上?serverTimezone=UTC,即默认0时区
1 | jdbc:mysql://192.168.44.128:3306/hive?serverTimezone=UTC |