(mysql.info.gz) CREATE DATABASE
Info Catalog
(mysql.info.gz) ALTER VIEW
(mysql.info.gz) Data Definition
(mysql.info.gz) CREATE INDEX
13.2.4 `CREATE DATABASE' Syntax
-------------------------------
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] DB_NAME
[CREATE_SPECIFICATION [, CREATE_SPECIFICATION] ...]
CREATE_SPECIFICATION:
[DEFAULT] CHARACTER SET CHARSET_NAME
| [DEFAULT] COLLATE COLLATION_NAME
`CREATE DATABASE' creates a database with the given name. To use
`CREATE DATABASE', you need the `CREATE' privilege on the database.
Rules for allowable database names are given in Legal names.
An error occurs if the database exists and you didn't specify `IF NOT
EXISTS'.
As of MySQL 4.1.1, `create_specification' options can be given to
specify database characteristics. Database characteristics are stored
in the `db.opt' file in the database directory. The `CHARACTER SET'
clause specifies the default database character set. The `COLLATE'
clause specifies the default database collation. Character set and
collation names are discussed in Charset.
Databases in MySQL are implemented as directories containing files that
correspond to tables in the database. Because there are no tables in a
database when it is initially created, the `CREATE DATABASE' statement
only creates a directory under the MySQL data directory (and the
`db.opt' file, for MySQL 4.1.1 and up).
If you manually create a directory under the data directory (for
example, with `mkdir'), the server considers it a database directory
and it will show up in the output of `SHOW DATABASES'.
`CREATE SCHEMA' can be used as of MySQL 5.0.2.
You can also use the `mysqladmin' program to create databases.
`mysqladmin' mysqladmin.
Info Catalog
(mysql.info.gz) ALTER VIEW
(mysql.info.gz) Data Definition
(mysql.info.gz) CREATE INDEX
automatically generated byinfo2html