异常错误: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.
这个问题 是在我整合项目过程中出现的,用了最新的mysql 连接驱动
以前版本的jdbc.properties
jdbc.driverClass = com.mysql.dbc.Driver
jdbc.url = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = root123
现在按照最新官方提示支持将com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Driver
jdbc.driverClass = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = root123
--------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------
mysql运行报The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone的解决方法
话不多说,从错误即可知道是时区的错误,因此只要将时区设置为你当前系统时区即可,
因此使用root用户登录mysql,按照如下图所示操作即可。

我电脑的系统为北京时区,因此在系统中设置后,再连接数据库运行,一切OK!
本文解决了MySQL连接驱动更新导致的问题,包括更改驱动类名及解决时区配置错误。
1万+

被折叠的 条评论
为什么被折叠?



