mysql copy a table code example
Example 1: mysql copy table with new name
CREATE TABLE IF NOT EXISTS new_table LIKE existing_table;
INSERT new_table
SELECT * FROM existing_table;
Example 2: clone table structure mysql
CREATE TABLE foo SELECT * FROM bar LIMIT 0
Or
CREATE TABLE foo SELECT * FROM bar WHERE 1=0