1. Home
  2. SQL
  3. MySQL Tutorial
  4. SQL – Create Database

SQL – Create Database


Use CREATE DATABASE statement to create a new database using mysql command. Login to MySQL server with administrative access to create a database.


CREATE DATABASE database_name;


Login to your MySQL server using the command line. You will get MySQL database prompt like mysql> . Now use CREATE DATABASE statement to create a database.

mysql> CREATE DATABASE mydb;

You can also use the following command directly on operating system command prompt without login to MySQL first.

$ mysqladmin -u root -p create mydb

To confirm that database is created properly use show databases command from database command prompt to list all databases.

Tags , ,
Was this article helpful to you? Yes 8 No 2