MySQL connector is a part of maven dependencies and all the database properties like url,username,password are mentioned in the application.properties.
Getting a RuntimeException, like:
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]
The spring-boot-starter-data-jpa is a starter for using Spring Data JPA with Hibernate. The mysql-connector-java dependency is for the MySQL database driver. The spring-boot-maven-plugin provides Spring Boot support in Maven, allowing us to package executable JAR or WAR archives.
Driver. Connection URL: The connection URL for the mysql database is jdbc:mysql://localhost:3306/sonoo where jdbc is the API, mysql is the database, localhost is the server name on which mysql is running, we may also use IP address, 3306 is the port number and sonoo is the database name.
Spring Boot has support for MySQL and a number of other popular relational databases. Out of the box, Spring Boot is very easy to use with the H2 Database. If the H2 database is found on your classpath, Spring Boot will automatically set up an in memory H2 database for your use.
Format of URL is wrong, use below URL
spring.datasource.url=jdbc:mysql://10.53.235.141:3306/hms
instead of
spring.datasource.url=jdbc/mysql://10.53.235.141:3306/hms
Your url is wrong use this
jdbc:mysql://10.53.235.141:3306/hms"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With