MySQL Creating databases

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [create_specification] /// To create database
  • DROP {DATABASE | SCHEMA} [IF EXISTS] db_name /// To drop database

Parameters

ParameterDetails
CREATE DATABASECreates a database with the given name
CREATE SCHEMAThis is a synonym for CREATE DATABASE
IF NOT EXISTSUsed to avoid execution error, if specified database already exists
create_specificationcreate_specification options specify database characteristics such as CHARACTER SET and COLLATE(database collation)


Got any MySQL Question?