SHOW CREATE TABLE
+3
T
O
d
q
This statement shows the exact statement to recreate an existing table using SQL.
Synopsis
- ShowCreateTableStmt
ShowCreateTableStmt ::=
"SHOW" "CREATE" "TABLE" (SchemaName ".")? TableName
Examples
mysql> CREATE TABLE t1 (a INT);
Query OK, 0 rows affected (0.12 sec)
mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`a` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.00 sec)
MySQL compatibility
The SHOW CREATE TABLE
statement in TiDB is fully compatible with MySQL. If you find any compatibility differences, report a bug.
See also
SHOW CREATE TABLE | TiDB SQL Statement Referencewas last updated 12/4/2024, 1:41:32 AM: *: init release-8.5 configs (#19545)