How to get your DB Tables automatically created with Spring Boot

Here is a sample configuration that will let Hibernate create the Database tables out of your Entity beans:

spring.datasource.driver-class-name=com.mysql.jdbc.Driver = org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto = create

Here are the possible values for :

  • validate: validate the schema, makes no changes to the database.
  • update: update the schema.
  • create: creates the schema, destroying previous data
  • create-drop: drop the schema at the end of the session

Additionally, if you want to log the schema creation, include these properties as well in your file: