DavidSzczesniak
1/19/2018 - 12:37 PM

Show the statement used to create a database

Use this to see how a certain database was created.

-- Show how the 'music' database was created
SHOW CREATE DATABASE music;
+----------+----------------------------------------------------------------+
| Database | Create Database                                                |
+----------+----------------------------------------------------------------+
| music    | CREATE DATABASE `music` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+----------------------------------------------------------------+

-- The same can be done for a table:
SHOW CREATE TABLE track;