在官方下载的源码,跑步起来,报:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.RuntimeException: Driver org.h2.Driver claims to not accept jdbcUrl, jdbc:mysql://127.0.0.1:3306/learn?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
### The error may exist in com/baomidou/mybatisplus/samples/quickstart/mapper/UserMapper.java (best guess)
### The error may involve com.baomidou.mybatisplus.samples.quickstart.mapper.UserMapper.selectList
### The error occurred while executing a query
### Cause: java.lang.RuntimeException: Driver org.h2.Driver claims to not accept jdbcUrl, jdbc:mysql://127.0.0.1:3306/learn?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false

google了一下,是因为springboot2.0以上,需要把url改为jdbc-url,再次启动测试类即可。

springboot版本导致Mabatis-Plus报错

原本:

springboot版本导致Mabatis-Plus报错

修改为:

springboot版本导致Mabatis-Plus报错

相关文章: