skip to Main Content

what is the application property setting to connect mysql in spring boot

I also want to generate the table automatically

I’m receiving this error in Spring Boot -Application properties I created Spring Boot starter project-Maven and opened application properties it shows Failed to create parts control please help how to solve this error

2

Answers


  1. Chosen as BEST ANSWER
    spring.datasource.url=jdbc:mysql://localhost:3306/school
    spring.datasource.username=root
    spring.datasource.password=password
    spring.jpa.show-sql=true
    spring.jpa.generate-ddl=true
    spring.jpa.hibernate.ddl-auto=update
    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
    

  2. Maybe take a look at springs guide Accessing data with MySQL.

    This guide also provides you with the following template for the applications.properties file:

    spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example
    spring.datasource.username=springuser
    spring.datasource.password=ThePassword
    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
    spring.jpa.hibernate.ddl-auto=update
    #spring.jpa.show-sql: true
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search