SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Sep 2006
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysqldump multiple tables on multiple --where

    Ok, so what I'm trying to do, I'm not even sure is possible, but if it were it would make life a little easier.

    So I have a database that has multiple tables. I want to mysqldump some of those tables and some of them mysqldump on a certain where. All of this inside a single command (if possible)

    So, here is an abbreviated example of what I'm trying to do. Is something like this possible? So far I can get a where to work on a single table at a time. But with multiple tables needing where's I'd like to put it all in one statement if possible.

    mysqldump -u user -ppassword database table1 --where="table1.user_id='1'" table2 --where="table2.location_id='123'" table3 table4 table5 --where="table5.some_id='abc 123'" > /home/some_file_data.sql

    Thanks in advance for any guidance and appreciate any suggestions or pointers (even if you are telling me I'm crazy! )

    Thanks in advance for any

  2. #2
    SitePoint Evangelist
    Join Date
    Sep 2006
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so it looks like I was stretching what mysqldump was intended for. So, I'm splitting up the commands and appending them to the same file.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •