[TriLUG] mysqldump of databases with foreign keys

Bradford Powell bcpowell at email.unc.edu
Fri Jul 9 15:27:58 EDT 2004


I asked this question on IRC, but apparently no one was around with any
ideas...

How does one go about making a backup of a mysql database that has foreign
keys? When I use mysqldump, it just dumps the tables in alphabetical
order. This results in some foreign key constraints being defined before
the tables they reference. Obviously this is an error condition. Is there
some way to automatically reorder the dump to take dependancies into
account or to inactivate foreign keys until after the dump is complete?

I never have this problem with pg_dump...

-- bradford powell
-- bradford_powell at unc.edu




More information about the TriLUG mailing list