DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info) create-database

Info Catalog (mysql.info) alter-table (mysql.info) data-definition (mysql.info) create-index
 
 13.1.3 `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.
 `CREATE SCHEMA' is a synonym for `CREATE DATABASE' as of MySQL 5.0.2.
 
 Rules for allowable database names are given in  legal-names. An
 error occurs if the database exists and you did not specify `IF NOT
 EXISTS'.
 
 CREATE_SPECIFICATION options 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.   charset, discusses character set and collation
 names.
 
 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
 creates only a directory under the MySQL data directory and the
 `db.opt' file.
 
 If you manually create a directory under the data directory (for
 example, with `mkdir'), the server considers it a database directory
 and it shows up in the output of `SHOW DATABASES'.
 
 You can also use the `mysqladmin' program to create databases. See
  mysqladmin.
 
Info Catalog (mysql.info) alter-table (mysql.info) data-definition (mysql.info) create-index
automatically generated byinfo2html