I have a DB which is 60 GB and I have a live DB which is 13 GB , now on the live DB there are some new entries and updated entries too. Consider 13GB DB has same initial data which 60 GB has with some rows updated and last few entries are completely new. No I want to copy that 13 GB to 60 GB. I have the dump but the insert commands and when I try to import it, it shows me the foreign key constrained error and says it cannot delete or update. So I need a query for MySQL import so that it will copy the new data and update the new if any, and also the dump file is regular dump file with create, insert all those and it is not possible to change anything inside it :(
If disk space isn't an issue here's how I would do it:
multi table delete
insert select
You will now have all rows from stuff_extra in stuff. And all data that was updated has been updated (or really deleted and inserted).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.