The CREATE DATABASE statement is used to create a new SQL database.
When you need to create databases dynamically from your scripts, here is a guide to do that using SQL and can apply to mySql
CREATE DATABASE databasename;
The following SQL statement creates a database called "testDB":
CREATE DATABASE testDB;
Tip: Make sure you have admin privilege before creating any database. Once a database is created, you can check it in the list of databases with the following SQL command: SHOW DATABASES;