使用mysql驱动程序使用mysql数据库设置spring-boot项目

时间:2019-01-08 12:02:40

标签: java mysql spring-boot

MySQL连接器是Maven依赖项的一部分,并且application.properties中提到了所有数据库属性,如url,用户名,密码。

获取类似Driver com.mysql.jdbc.Driver的RuntimeException声称不接受jdbcUrl,jdbc / mysql://10.53.235.141:3306 / hms。

请帮助解决方案

application.properties

 spring.datasource.url=jdbc/mysql://10.53.235.141:3306/hms
 spring.datasource.username="root"
 spring.datasource.password="password"
 spring.datasource.driverClassName=com.mysql.jdbc.Driver
 spring.jpa.database = MYSQL

[![Project setup structure][1]][1]

Exception in the console

2 个答案:

答案 0 :(得分:1)

您的网址不正确,请使用此

jdbc:mysql://10.53.235.141:3306/hms"

答案 1 :(得分:1)

URL格式错误,请在URL下方使用

spring.datasource.url=jdbc:mysql://10.53.235.141:3306/hms

代替

spring.datasource.url=jdbc/mysql://10.53.235.141:3306/hms