hello__world3
折断翅膀的麻雀
采纳率0%
2017-03-29 06:09

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • engchina engchina 4年前

    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

    点赞 1 评论 复制链接分享
  • qq_36224522 Onion-- 4年前

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

    点赞 1 评论 复制链接分享

相关推荐