Copying a table in MySQL and including a primary key
I have an old piece of code that I am using to copy tables in MySQL.
CREATE TABLE new_table (select * from old_table);
This works great with one exception. It does not copy the primary key or other table indexes.
Is there a way to copy a table in MySQL AND include indexes / primary key
+2
a source to share
2 answers