Use CREATE TABLE ... LIKE to create an empty
table based on the definition of another table, including any
column attributes and indexes defined in the original table:
CREATE TABLEnew_tblLIKEorig_tbl;
The copy is created using the same version of the table storage
format as the original table. The
SELECT privilege is required on
the original table.
LIKE works only for base tables, not for
views.
Beginning with MySQL 5.6.1, you cannot execute CREATE
TABLE or CREATE TABLE ... LIKE
while a LOCK TABLES statement
is in effect.
Also as of MySQL 5.6.1,
CREATE TABLE ...
LIKE makes the same checks as
CREATE TABLE and does not just
copy the .frm file. This means that if
the current SQL mode is different from the mode in effect when
the original table was created, the table definition might be
considered invalid for the new mode and the statement will
fail.
CREATE TABLE ... LIKE does not preserve any
DATA DIRECTORY or INDEX
DIRECTORY table options that were specified for the
original table, or any foreign key definitions.
If the original table is a TEMPORARY table,
CREATE TABLE ... LIKE does not preserve
TEMPORARY. To create a
TEMPORARY destination table, use
CREATE TEMPORARY TABLE ... LIKE.