Skip navigation links

MySQL Forums :: Newbie :: How do I copy a table from one MySql schema to another mySql schema in MySl?


Advanced Search

Re: How do I copy a table from one MySql schema to another mySql schema in MySl?
Posted by: Anthony Willard ()
Date: November 08, 2006 01:22PM

If it's on the same server just a different database, you can use
CREATE TABLE newdb.mynewtable LIKE olddb.myoldtable;

You can then insert data into the new table from the old using
INSERT newdb.mynewtable
SELECT *
FROM olddb.myoldtable;

If they are on different servers, you can use the "mysqldump" command line utility to dump the structure and/or data to a file, then run the file on the new server. Use "--tables" to specify which table(s) you need to migrate.

Anthony

Options: ReplyQuote


Subject Written By Posted
How do I copy a table from one MySql schema to another mySql schema in MySl? David Hannes 11/08/2006 12:33PM
Re: How do I copy a table from one MySql schema to another mySql schema in MySl? Anthony Willard 11/08/2006 01:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.