Duplicating a MySQL table, indices, and data
Apart from the solution above, you can use AS
to make it in one line.
CREATE TABLE tbl_new AS SELECT * FROM tbl_old;
To copy with indexes and triggers do these 2 queries:
CREATE TABLE new_table LIKE old_table;
INSERT INTO new_table SELECT * FROM old_table;
To copy just structure and data use this one:
CREATE TABLE new_table AS SELECT * FROM old_table;
I've asked this before:
Copy a MySQL table including indexes