MySQL: Steps for creating a DB

MySQL Installation

First you need to install the MySQL server on your local environment. As soon as the installation is finished, the server should be up and running.

MySQL WORKBENCH

I use MySQL WORKBENCH extensively for creating and managing easily all my databases. You must install MySQL WORKBENCH on your computer if you've not done that yet.

You can easily add a connection via this window :



Create Schema

  1. Add a new Model (File/New Model)
  2. Edit the default schema (On Physical Schemas, right click 'mydb')
  3. Change the schema name
  4. Add tables, views...

Forward Engineer to Database

We assume that your schema is ready to 'deploy' to your MySQL server.

  1. Click Database/Forward Engineer...
  2. Select your MySQL server
  3. Accept default options values
  4. Revue the SQL script to be executed
  5. Click next to continue
The database should have been successfully created on your MySQL server.

Adding administrator for the created database

Open your MySQL server instance on MySQL WORKBENCH :

Run this script for adding an administrative user for the selected database:


As you can see, the user can only access the car_db database.

Comments

Popular posts from this blog

Spring JPA : Using Specification with Projection

Chip input using Reactive Form