Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using MySQL db.

I want to dump a set of rows from one table and if these rows have foriegn keys that point to rows on some other tables, I want to dump those too.

Then I want to load these dumps into their respective tables on a different database (e.g using LOAD DATA INFILE command). So simply using select...join...into outfile is not enough since the result would be one big joined table.

For example table A has B_id and C_id columns that point to rows on table B and C respectively. So when I dump 3 rows from table A, 3 related rows from B and 3 from C are dumped too.

Does such a tool/script exist?

Writing a script to do that is very doable, but I don't want to reinvent the wheel if such a tool already exist.

share|improve this question

I think Jailer is what you are looking for:

(Though I haven't used it so far)

share|improve this answer
+1 for a very nice looking tool. Will have to check it out. – Derek Downey Apr 20 '12 at 14:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.