You are currently viewing Spring Boot Masterclass – Setup the MySQL database 02

Spring Boot Masterclass – Setup the MySQL database 02

Hello in this post, we will set up the MySQL database and we configure the data source in the spring boot project. let’s begin.

Create a MySQL database,

CREATE DATABASE ecom;

Execute the query to create the expense table,

CREATE TABLE tbl_expenses
(
    id BIGINT(20) PRIMARY KEY NOT NULL AUTO_INCREMENT,
    amount DECIMAL(19, 2) NOT NULL,
    created_at BIGINT(20) NOT NULL,
    description VARCHAR(255) NOT NULL,
    note VARCHAR(255)
);



Next, configure the data source in the spring boot project. Add the following code inside the application.properties file

spring.datasource.url=jdbc:mysql://localhost:3306/ecom?useSSL=false
spring.datasource.username=expensetracker
spring.datasource.password=expensetracker

# spring.jpa.generate-ddl=true

 

Bushan Sirgur

Hey guys, I am Bushan Sirgur from Banglore, India. Currently, I am working as an Associate project in an IT company.

This Post Has 2 Comments

  1. Alem Aweke

    Hi Bushan,
    I started to work on an Angular 8/Spring boot project you shared on YouTube and found out later that those videos are no more there. Shall we expect that you share them again?

    Thank you.

Leave a Reply