2

My application.properties is :

spring.datasource.url=jdbc:mysql://localhost:3306/bdd_disc?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=MP18711922
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELEC 1

# Show or not log for each sql query
spring.jpa.show-sql = true

# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update

# Naming strategy
spring.jpa.hibernate.naming-strategy =   org.hibernate.cfg.ImprovedNamingStrategy

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

When I make a maven Build and try to run the main SpringBoot class I have the following message :

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
ATN54
  • 117
  • 2
  • 2
  • 6
  • see https://stackoverflow.com/questions/51221777/failed-to-configure-a-datasource-url-attribute-is-not-specified-and-no-embedd – Ori Marko Mar 17 '19 at 08:04

1 Answers1

1

OK, I found the problem by adding :

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

in application.properties.

Sorry...

ATN54
  • 117
  • 2
  • 2
  • 6