springboot之异常处理

我在使用springboot的时候,运行主类结果报错 :
异常错误: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.
我在网上找了很多的资料,以及大家的经验,最后发现了自己的问题,出现这种问题的原因是版本更新,与其他版本造成显示新版本的数据库连接程序需要指定utc时区,接下来的改正方法是:在application.properties配置文件中找到自己的url在后面加上指定的时区即可,
egg:“url=jdbc:mysql://localhost:3306/db&serverTimezone=GMT”这样再次运行就不会出现上面的error了。

原文地址:https://www.cnblogs.com/wenqihe/p/12676295.html