All pages
Powered by GitBook
1 of 1

Loading...

SHOW CREATE DATABASE

View the CREATE DATABASE statement. This statement returns the SQL syntax required to recreate a specific database with its current options.

Syntax

SHOW CREATE {DATABASE | SCHEMA} db_name

Description

Shows the CREATE DATABASE statement that creates the given database. SHOW CREATE SCHEMA is a synonym for SHOW CREATE DATABASE. SHOW CREATE DATABASE quotes database names according to the value of the server system variable.

Examples

With turned off, the output looks slightly differently:

See Also

This page is licensed: GPLv2, originally from

sql_quote_show_create
sql_quote_show_create
CREATE DATABASE
ALTER DATABASE
Character Sets and Collations
fill_help_tables.sql
SHOW CREATE DATABASE test;
+----------+-----------------------------------------------------------------+
| Database | Create Database                                                 |
+----------+-----------------------------------------------------------------+
| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+-----------------------------------------------------------------+

SHOW CREATE SCHEMA test;
+----------+-----------------------------------------------------------------+
| Database | Create Database                                                 |
+----------+-----------------------------------------------------------------+
| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+-----------------------------------------------------------------+
SHOW CREATE DATABASE test;
+----------+---------------------------------------------------------------+
| Database | Create Database                                               |
+----------+---------------------------------------------------------------+
| test     | CREATE DATABASE test /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+---------------------------------------------------------------+

In the DEFAULT clause of a SHOW CREATE statement, numbers are quoted.