MySQL Forums
Forum List  »  Backup

Re: MYSQLDUMP: Export a table data and Import in a different table
Posted by: Rick James
Date: December 18, 2014 11:55PM

"similar structure"?

mysqldump works well if the structures are close enough. What are the differences?

I would probably do, instead,
INSERT INTO new_table (a,b,c)
SELECT a,b,c FROM old_table;

By using INSERT..SELECT, I could account for
* Different number of fields,
* Modifying the data for any field(s),
* Deal with incompatible datatypes,
* Rearrange the order of the fields,
* etc.

mysqldump probably cannot handle any of those differences in structure.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MYSQLDUMP: Export a table data and Import in a different table
1496
December 18, 2014 11:55PM


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.