How can I dump a specific table or set of tables without including the rest of the db tables?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
If you are dumping tables t1, t2, and t3 from mydb
If you have a ton of tables in mydb and you want to dump everything except t1, t2, and t3, do this:
Give it a Try !!!
UPDATE 2014-03-06 10:15 EST
@RoryDonohue pointed out to me that the GROUP_CONCAT function needs to have its max length extended. I added the session variable group_concat_max_len to my answer with a length max of 10K. Thanks, @RoryDonohue.
A note to expand on the answer by RolandoMySQLDBA.
The script he included is a great approach for including (
If you just need to exclude one or two tables, you can exclude them individually with the
When you have more than a few tables it is much better running something like this:
or somethink like this:
You can do it simply using below command:
protected by Paul White♦ Jul 18 '14 at 7:22
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?