Stats

143 Contributors: 6
2016-10-10
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Creating databases

Download mysql eBook

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)

Related Examples