Skip to content

MySQL copy table to another database

Syntax to copy one existent MySQL table from one database to another database:

  CREATE TABLE `new_database`.`table` SELECT * FROM `old_database`.`table`;

Syntax to copy one existent MySQL table to another table in the same database:

  CREATE TABLE `database`.`table` SELECT * FROM `database`.`table`;

That’s it.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments