yml中driver-class-name: com.mysql.jdbc.Driver 解析不到的问题 java 连接数据库
当在idea中使用springboot的快捷创建方式时,选中了mysql 和jdbc 那么pom文件中会直接有
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
当在yml文件中写入
- spring:
- datasource:
- data-password:
- data-username:
- url:
- driver-class-name: com.mysql.jdbc.Driver
driver-class-name 会解析不到此时的解决方法是
给上mysql完整的依赖就可以解决这个问题了
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>8.0.12</scope>
- </dependency>
转载自:http://www.cnblogs.com/zhulina-917/p/10219221.html
https://blog.csdn.net/xiao_yi_xiao/article/details/89603988 标签:jdbc,java,name,driver,mysql,class From: https://www.cnblogs.com/sunny3158/p/16651769.html