关于mybatis-plus报错问题
异常错误:Loading class `com.mysql.jdbc.Driver’. This is deprecated. The new driver cl
1.新版本的mybatis-plus仅支持mysql8以上并且完全抛弃了com.mysql.jdbc.Driver这个数据库池
需要把配置文件com.mysql.jdbc.Driver修改成com.mysql.cj.jdbc.Driver即可
# 数据源的配置
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.url=jdbc:mysql://localhost:3306/shouhuan
2.修改之后会继续报错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配置后面加shouhuan?serverTimezone=GMT%2B8即可
代码如下
spring.datasource.url=jdbc:mysql://localhost:3306/shouhuan?serverTimezone=GMT%2B8
注:此代码运行环境为springboot版本为2.1.5版本 仅供参考
版权声明:本文为weixin_55887628原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。