get create statement in mysql code example
Example 1: mysql show create table
Copied mysql> SHOW CREATE TABLE t\G
*************************** 1. row ***************************
Table: t
Create Table: CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`s` char(60) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
Example 2: mysql show create db
SHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
If the SHOW statement includes an IF NOT EXISTS clause, the output
too includes such a clause. SHOW CREATE SCHEMA is a synonym for
SHOW CREATE DATABASE.