backup particular table with ssh

Discussion in 'The Lounge' started by cookie, Oct 23, 2007.

  1. cookie

    cookie Alien

    Easy Question :

    Guys any body knows how to get backup of particular tables
    for example all tables starting with phpbb_
    into my public_html just using ssh
    I need the command

    Thanks
     
  2. ppc

    ppc Moderator

    You can use the mysqldump command to take a backup of that database but I believe with this you cannot select a certain table within a database:

    Code:
    [B]mysqldump -IPADDRESS -USERNAME -PASSWORD DATABASENAME > OutputFile Name[/B] 
     
  3. cookie

    cookie Alien

    Yes Thanks I have seen that but strange thing is that not body seems to know How I can just backup a particular table:confused:
     
  4. ppc

    ppc Moderator

    Pretty sure I figured it out. Try this:

    Code:
    mysqldump --user usernamehere --password=paswordhere databasenamehere tablenamehere > /path/to/directory/to/dump/file/dump.sql
    Should do the trick ;)
     
  5. cookie

    cookie Alien

    hey thanks but one thing to confirm

    it is not one table , it is all tables which is

    phpbb2_

    what I mean supposing I have 1000 tables related to differenty forum softwares
    like smf and bla bla bla
    and I want to extract and backup all tables starting with phpbb2_

    because I want to take my phpbb forum backup only

    what should I do with ssh?
     
  6. Dan

    Dan Moderator

    Then you'd run the same command against each database...
     
  7. ppc

    ppc Moderator

    So you mean you only have 1 database and within that database you have thousands of tables for several programs?
     
  8. cookie

    cookie Alien

    not thousands LOL but before I get vps I was on a shared hosting and they allowed only one database so I had to install most of my stuffs there that is the problem now I want to extrace some of them from there
    on the other hand I want to learn how to do this because some body before asked me the similar question
     

Share This Page