Rob Rob - 1 year ago 86
SQL Question

MySQL 'create schema' and 'create database' - Is there any difference

Taking a peak into the

database and peaking at the metadata for one of my pet projects, I'm having a hard time understanding what (if any) differences there are between the
create schema
command and the
create database
command for MySQL.

Are there any differences? If not, is this a rather typical pattern of behavior for relational databases (I've heard that for other databases, such as Oracle, a schema exists in a database, rather than being on the same level as a database).


Answer Source

The documentation of MySQL says :

CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2.

So, it would seem normal that those two instruction do the same.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download