hibernate所遇见的错误

 错误:

     org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

     Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.

    翻译:caused by:com.mysql.cj.exceptions.invalidconnectionattributeexception:服务器的时间价值是Öйú±ê׼ʱ¼ä地区代表more than one time换的黄金地带。你必须配置JDBC驱动(either the服务器或通过the servertimezone配置Property)to use a more time地区specifc价值如果你想用它的时候支撑区域


     解决:

                    通过最后一句我们知道,JDBC 8以上的版本必须配置时区

                   所以要在连接MySQL服务器地址的位置跟上?serverTimeZone=UTC

         <property name="hibernate.connection.url">jdbc:mysql:///hibernate_day01?serverTimezone=UTC</property>

   Hibernate核心配置文件: