GobsRuiz
GobsRuiz

Reputation: 522

Spring - how to connect to database mysql

I'm trying to connect to the mysql database, but to no avail. I put the dependencies of mysql and spring boot start jdbc and jpa.

enter image description here

I added the following lines to aplciation.properties.

spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/springone 
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

I'm using the xampp and the door is 3306.

When I run the project, a lot appears on the console. I took a print from the end.

enter image description here

I'm using the visual studio code editor

Upvotes: 1

Views: 665

Answers (1)

zawarudo
zawarudo

Reputation: 2506

Try

spring.datasource.url=jdbc:mysql://localhost:3306/springone?serverTimezone=UTC

instead of

spring.datasource.url=jdbc:mysql://localhost:3306/springone

Upvotes: 1

Related Questions