SQL CREATE DATABASE

SQL CREATE DATABASE

 SQL CREATE DATABASE


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

Syntax

CREATE DATABASE database_name;

Example

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

mysql> CREATE DATABASE mydb;

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

$ mysqladmin -u root -p create mydb

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

Reactions

Post a Comment

0 Comments

close