There are several possible causes:
-
Your entity classes are in the same or in a sub-package relative one where you have you class with
@EnableAutoConfiguration.
If not then your spring app does not see them and hence will not create anything in db -
Check your config, it seems that you are using some hibernate specific options, try to replace them with:
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect spring.jpa.hibernate.ddl-auto=update spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/test spring.datasource.username=test spring.datasource.password=
**note that the manual loading of the driver class is unnecessary because it’s automatically registered, so don’t bother yourself with it
- Your
application.properties
must be insrc/main/resources
folder.
If you did not specify dialect correctly it might try to default to bundled together with boot in-memory database and (as it was with me) I could see that it tries to connect to local HSQL
(see console output) instance and fail at updating the schema.