Monday, 10 February 2014

MySQL Create Database Query Example

Go to Start Menu and find and run mysql:

on the mysql prompt first check if a database with the same name already exit.


  • mysql> SHOW DATABASES;

If your database is not in the provided list then run the following query to create a database:

CREATE DATABASE <DATABASENAME>;

Replace the  <DATABASENAME> with your database name.

For example to create a database with the name test:

  • mysql> CREATE DATABASE test;
In order to check if your database is created then run the show databases query again.


  • Commands do not have to be entered in the upper case.
  • All MySQL queries must end with the semicolon ";"







No comments:

Post a Comment