I would like to update all records in a MySQL table by first truncating the table and then importing new data from a file.
The issue I am encountering is that I have defined foreign key constraints on the primary key of the table I would like to update, which (rightfully) prevents me from truncating the table and inserting new (updated) data.
The source file for the update I would like to perform contains both updates to existing records and new records to be inserted, so it would not be sufficient to insert only the new records.
I am 100% confident that the primary keys in the existing table and the primary keys in the file match and that the number and type of attributes, as well as all entity constraints, are satisfied. Due to system limitations, it is not sufficient to update the database table; I must export from one system and import into another.
My question is this: is there a way to either truncate and import within a single transaction in order to maintain a consistent state or use phpMyAdmin to import updates and new records, leaving the current data intact?
If it is helpful to know, I am using phpMyAdmin 4.3.8.