使用mysql驱动程序使用mysql数据库设置spring-boot项目 [英] Setup spring-boot project with mysql database using mysql driver

查看:347
本文介绍了使用mysql驱动程序使用mysql数据库设置spring-boot项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

MySQL connector is a part of maven dependencies and all the database properties like url,username,password are mentioned in the application.properties.

获取RuntimeException,例如:

Getting a RuntimeException, like:

驱动程序com.mysql.jdbc.Driver声称不接受jdbcUrl, jdbc/mysql://10.53.235.141:3306/hms.

Driver com.mysql.jdbc.Driver claims to not accept jdbcUrl, jdbc/mysql://10.53.235.141:3306/hms.

请提供解决方案的帮助.

Please help with the solution.

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]

推荐答案

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

Format of URL is wrong, use below URL

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

代替

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

这篇关于使用mysql驱动程序使用mysql数据库设置spring-boot项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆