Created
January 8, 2019 14:10
-
-
Save robozavri/fe87ee8118e651a7f725188ff87616e8 to your computer and use it in GitHub Desktop.
Duplicating a MySQL table, indexes and data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE newtable LIKE oldtable; | |
| INSERT newtable SELECT * FROM oldtable; | |
| To copy just structure and data use this one: | |
| CREATE TABLE tbl_new AS SELECT * FROM tbl_old; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment