MySQL : CREATE DATABASE Statement

Here's the basic syntax for creating a MySQL database:


CREATE DATABASE database_name;
 

Replace database_name with the desired name for your database. For example:


CREATE DATABASE my_database;
 

This will create a database named my_database.

You can also optionally specify character set and collation for the database. Here's an example:


CREATE DATABASE my_database
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

 

This sets the character set to utf8mb4 and the collation to utf8mb4_unicode_ci, which is commonly used for supporting a wide range of characters and languages.

Remember, you may need appropriate privileges to create a database depending on your MySQL user permissions.