CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
The CREATE DATABASE statement is used to create a new SQL/MySQL database.
Syntax
CREATE DATABASE databasename;
CREATE DATABASE Example
The following SQL statement creates a database called "testDB":
Example
CREATE DATABASE testDB;
CREATE DATABASE nameOfYourDatabase;
USE nameOfYourDatabase;
CREATE TABLE nameOfTable(
id INT AUTO_INCREMENT,
first_name VARCHAR(100),
last_name VARCHAR(100),
email VARCHAR(50),
password VARCHAR(20),
PRIMARY KEY(id)
);
mysql -u username -p
CREATE DATABASE dbname;
mysql> CREATE DATABASE pets;
Query OK, 1 row affected (0.01 sec)
CREATE DATABASE `mydb`;
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_option] ...
create_option: {
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
}