SSM jdbc报错 Cannot create PoolableConnectionFactory

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: 
Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException:
 Cannot create PoolableConnectionFactory 
 (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.)

无法解析时区,在URL后追加上serverTimezone=UTC

<bean id="" class="">
	<property name="driverClassName" value="com.mysql.cj.jdbc.Driver">property>
	<property name="url" value="jdbc:mysql://localhost:3306/mytest?serverTimezone=UTC">property>
	<property name="username" value="root">property>
	<property name="password" value="123456">property>
bean>

你可能感兴趣的:(Java编程)