The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized...

 


报错内容:

 
  1.  
  2. 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 wan


报错原因:

在使用MySQL 8.0的时候出现的问题错误。数据库系统时区差异引起的问题。


解决方法:jdbc连接的url 的后面加上serverTimezone=UTC或GMT即可,如果指定使用gmt+8时区,需要写成GMT%2B8


修改前

	<property name="jdbcUrl" value="jdbc:mysql://localhost/spring"/>

 修改后

<property name="jdbcUrl" value="jdbc:mysql://localhost/spring?serverTimezone=GMT%2B8"/>

猜你喜欢

转载自blog.csdn.net/qq_35568099/article/details/85001389