Copying MySQL table to another table with no missing new changes
1
vote
2
answers
579
views
I would like to recreate/copy a MySQL table (a actual new ibd file) - and most of the suggestions recommends the following :
CREATE TABLE mytbcopy LIKE mytb;
INSERT INTO mytbcopy SELECT * FROM mytb;
The suggestion works well - but from my understanding (correct me if I'm wrong), it does not insert/update records in the new table during the period of copying/recreating.
Example : During the copying, if record #45 is already inserted into the new table, and there was an update on record #45 on the original table - it won't be replicated over
Is there another way to ensure that after the full copying of data over, the data on the new table will be in the most updated state? I'm not sure using TRIGGERS is the solution for this.
Asked by SleepingHide123
(21 rep)
Dec 13, 2019, 02:37 AM
Last activity: Apr 21, 2025, 01:03 PM
Last activity: Apr 21, 2025, 01:03 PM