使用jdbc访问数据库过程中,出现报错
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
com.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Exception in thread “main” org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.

主要是两个错误:
第一个是项目中使用的mysql驱动太低了,要换成com.mysql.cj.jdbc.Driver
第二是时区错误,应该改成下面这样:
dbc:mysql://localhost/spring?useSSL=false&serverTimezone=UTC