Reputation: 175
My objective is to duplicate the tables and columns with constraints included from one database to another within a mysql server.
Is there any query possible for this purpose ?
This has to be done without copying the table data from one database to another.
Upvotes: 1
Views: 33
Reputation: 191
You can achieve the same by using the two methods mentioned below:
Use CREATE TABLE new_table LIKE other_db_name.other_table;
You can check the create statement by SHOW CREATE TABLE and copy that statement to create a new table without copying the data.
I hope it helps!
Upvotes: 1