Spring Boot+Mysql启动报错
2019-06-18 本文已影响0人
葉糖糖
开发过程中使用的是MySql5.7的数据库,启动Spring Boot工程遇到如下错误:
1、错误信息提示
java.sql.SQLException: 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.
2、解决问题方案
阅读错误提示信息得知这个错误与MySql的时区设置有关系。
第一种方案:直接修改JDBC连接字符串,在其中添加&serverTimezone=UTC
即可;
第二种方法:修改数据库中的设置。
3、细心思考问题
驱动包版本过高会引发这样的问题。