Unable to connect mysql to spring boot project

后端 未结 6 2044
庸人自扰
庸人自扰 2020-12-31 10:08

i am following this https://spring.io/guides/gs/accessing-data-mysql/ guide to connect mysql db to spring boot project

but getting following error when running the a

6条回答
  •  独厮守ぢ
    2020-12-31 10:30

    It seems like the application may not be running with the correct classpath as it seem to be having difficulty locating the mysql driver. Are you trying to run the application through the IDE?

    Try running the application via maven using the command line from the project's directory:

    ./mvnw spring-boot:run

    If this works then it's a problem with the IDE, for some reason it's not providing the correct classpath when running your application. I'm not familiar with STS but in IntelliJ there are options like "auto import pom" to keep the IDE's view of the project in sync with the pom.

提交回复
热议问题