当前位置:   article > 正文

mysql启动报错 Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.my_loading class `com.mysql.jdbc.driver'. this is dep

loading class `com.mysql.jdbc.driver'. this is deprecated. the new driver cl

问题1:mysql启动报错 Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

报错原因是配置文件的driver-class-name用了旧的,新的驱动已经进行修改:
旧的:com.mysql.jdbc.Driver
新的: com.mysql.cj.jdbc.Driver
把驱动换成新的旧不会报错了。

问题2:Cause: 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.

报错问题是配置文件连接数据库的url问题:
没改之前的url:jdbc:mysql://localhost:3306/自己的数据库
解决方案 url: jdbc:mysql://localhost:3306/dm_svr?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/812396?site
推荐阅读
相关标签
  

闽ICP备14008679号