What would seem like a complex task — creating a new database — is possibly the simplest statement of all!
Syntax
The syntax is extremely simple:
CREATE DATABASE `databasename`;
Naming conventions for databases vary. Stick to a short, simple, descriptive name consisting of lowercase letters only and you can’t go wrong.
Example
We will use MySQL Workbench to create our new database with the following statement:
CREATE DATABASE `dbtest`;


- Select the Query window
- Type the following SQL statement:
CREATE DATABASE dbtest;
- Click the Execute button
- The result displayed in the Output panel
- Click the Refresh button
- The new database, dbtest, appears in the Navigator panel
Next step
To add a user with some privileges to your new database, see the CREATE USER & GRANT PRIVILEGES in MySQL tutorial.
References:
- W3schools. (2023). SQL CREATE DATABASE Statement. Available at: https://www.w3schools.com/sql/sql_create_db.asp (Accessed: 25 February 2023).