How to duplicate MySQL table quickly

Posted by admin on Thu, 09/19/2019 - 06:17

The qickest way to duplicate MySQL table.

CREATE TABLE newtable LIKE oldtable; 
INSERT newtable SELECT * FROM oldtable;

To just duplicate all structure and data:

CREATE TABLE tbl_new AS SELECT * FROM tbl_old;

Hey! Don't miss a new cool stuff!

Add new comment