I use a bash script that dumps separate areas of a single database to separate dump files. Currently the files are dumped in this order:
- Database, table and view schema.
- Routines.
- Triggers.
- Events.
- Data.
Now, I was wondering – in what order should I import the data if I were to?
I have one concern if I were to import the dumps in the same order – if I import triggers before importing data, will they be “triggered” during import?
Should I import schema first, then data and then the rest? Is there any particular order I should be doing this?
I’ll answer myself in case anyone needs to know explicitly.
As @ajreal suggested, the best way would be follow the order mysqldump outputs. And mysqldump’s order is as follows: