In this tutorial, you will learn about MySQL, how to create SQL databases, tables and various data types.
Prerequisites
You need to have MySQL server installed on your machine along with the MySQL client.
Create DATABASE | Create schema in MySQL
You can create a database in MySQL using the SQL instruction CREATE DATABASE .
Open a new terminal and invoke the mysql client using the following command: $ mysql -u root -p
Enter the password for your MySQL server when prompted.
You can now execute SQL statments. Let's see an example of creating a database named mydb: mysql> create database mydb;
Note: You can also use create schema for creating a database.
You can also add other parameters.
CREATE DATABASE IF NOT EXISTS
You can create multiple databases in your MySQL server. When using the IF NOT EXISTS parameter, you tell MySQL to create the …
[Read more]