WARNING: Unexpected exception resolving reference
java.sql.SQLException: The server timezone value '◇□' is unrecognized or represents more than one timezone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc timezone value if you want to utilize timezone support.
stackflow上有人提出了这个问题,说是mysql的connector jar 从5.1.33-5.1.37 的TimeUtil类存在bug
stackflow地址:http://stackoverflow.com/questions/26515700/mysql-jdbc-driver-5-1-33-time-zone-issue
我用的刚好是5.1.37,出现这个问题
换了最新版 6.0.2还是有这个问题
再换了个 5.1.18 OK,非常奇怪
2016年7月4日 14:44:33
版本6.0.2
在连接的url后加一个参数 serverTimezone=GMT ,这里的时区可以根据自己数据库的设定来设置
之后还可能会出现另一个错误,mysql新的安全性设置要求SSL连接,此处可以加一个参数userSSL=false,或者自己设置SSL也可以
另外,6.0.2版本的driverClassName不再是原来的路径,改成com.mysql.cj.jdbc.Driver了