使用mysql-connector-java-6.0.6.jar

2017-10-10  本文已影响0人  hui2743

异常:

spring

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

servlet

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.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException

解决:

jdbcUrl=jdbc:mysql://localhost:3306/db

改为:

jdbcUrl=jdbc:mysql://localhost:3306/db?serverTimezone=UTC
上一篇下一篇

猜你喜欢

热点阅读