之前代码出现这个错误,找了一个整天还是找不到,最后换jar包排除了错误。上代码:
先看application.properties的配置信息有无出错(一开始我配的是spring.datasource.data-username= 就出现了问题)
spring.datasource.driver-class-name= spring.datasource.username= spring.datasource.password= spring.datasource.url= 再看jar包:
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.2</version> </dependency>
结束