The problem, apparently, is that you are setting the login only for the DML scripts, as correction should add the login data in the default DB, besides this you need to define the properties hibernate.dialect
and ddl-auto
and finally add &allowPublicKeyRetrieval=true
in the DB url:
# URL para DB
spring.datasource.url=jdbc:mysql://localhost/teste?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true
# Dados default de acesso para ao DB
spring.datasource.username = root
spring.datasource.password = 1234
# Dados para execuçao de scripts DML
# Somente é necessario se for diferente dos dados default
spring.datasource.data-username = root
spring.datasource.data-password = 1234
# Caso queria definir dados de login para execuçao de scripts DDL
# Assim como data-username somente é necessario se for diferente dos dados default
# spring.datasource.schema-username = root
# spring.datasource.schema-password = 1234
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true