Cannot load driver class: com.mysql.jdbc.Driver

各位大神

我使用spring-boot,maven管理项目,在pom中添加mysql依赖包后再添加jpa依赖包就报错:Caused by: java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver

这点错误只知道不能加载驱动。你看一下我的博客。

do this work?

I solved this by trial and error. What did it for me was to remove a driver reference form application.properties file.

pring.datasource.url = jdbc:mysql://localhost:3306/test
spring.datasource.username = test 
spring.datasource.password = test
#spring.datasource.driver-class-name = com.mysql.jdbc.Driver 

refer url:
http://stackoverflow.com/questions/27758717/cannot-load-driver-class-com-mysql-jdbc-driver-with-gradle-and-spring-boot