Mydumper 0.5.1 ssh commands for backup and restore

Discussion in 'Site & Server Administration' started by ASTRAPI, Jan 2, 2012.

  1. #1
    Hello

    I just download to test the mydumper but i was confuse with the documantation :(

    Can anyone please post the ssh command to backup my database and the command to restore it?

    Example to use on the commands:
    database name: mydatabase
    sql root password: rootpass


    Also after uploading the mydumper-0.5.1.tar.gz how can i unzip it and compile it?

    Thank you
     
    ASTRAPI, Jan 2, 2012 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Hello there,

    If you have ssh access, why not just dump the database from the command line directly?

    mysqldump -u user -p database_name > /path/to/where/you/want/the/dump/to/go/dump.sql
    Code (markup):
    Chris
     
    RHS-Chris, Jan 2, 2012 IP
  3. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Mydumper is better :)

    Mydumper features

    Lightweight C source
    Up to 10x faster dumps compared to mysqldump
    Consistent snapshots for transactional and non-transactional tables (in 0.2.2 onwards)
    File compression on-the-fly
    Binary log dumps
    Multi-threaded restore utility (in 0.2.1 onwards)
    Daemon mode for timed snapshots and continuous binary logs (in 0.5.0 onwards)

    So i want to use this one :)
     
    ASTRAPI, Jan 2, 2012 IP
  4. Orangu

    Orangu Active Member

    Messages:
    571
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Database backup (asuming db is in localhost):
    ssh USERNAME@YOURSERVER.COM 'mydumper -u USERNAME -p PASSWORD -B DATABASE_TO_DUMP -o OUTPUT_DIRECTORY'
    Code (markup):
    Database restore:
    ssh USERNAME@YOURSERVER.COM 'myloader -d PATH_TO_MYDUMPER_BACKUP -u USERNAME -p PASSWORD'
    Code (markup):
    Isn't it available for download on your distro's repository?
     
    Last edited: Jan 2, 2012
    Orangu, Jan 2, 2012 IP
  5. lachrymologist

    lachrymologist Active Member

    Messages:
    456
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #5
    well, you obviously need to compile it first

    to extract it:
    tar -xf mydumper-0.5.1.tar.gz
    Code (markup):
    then read the manual on that folder to compile it
     
    lachrymologist, Jan 3, 2012 IP
  6. supportex

    supportex Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    mysqldump is stable and reliable solution working during years. So for small databases I would go with it too.
     
    supportex, Jan 3, 2012 IP
  7. amigoserv.com

    amigoserv.com Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorry the correct is
     tar -zxf mydumper-0.5.1.tar.gz
    Code (markup):
    and @supprtx , this script is for small databases only
     
    Last edited: Jan 4, 2012
    amigoserv.com, Jan 4, 2012 IP
  8. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ok lets say that i am on home directory on my server using ssh and i have install there the mydumper and i got there the database backup..

    If i have this info:

    database backup file: mydb.sql
    new empty database to add the backup here name: mydatabase
    sql username: root
    sql root password: rootpass

    How can i configure the import command?
     
    ASTRAPI, Jan 4, 2012 IP
  9. lachrymologist

    lachrymologist Active Member

    Messages:
    456
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #9
    nope, you can still extract gzip archive without the 'z' option

    here:
    mysql -u root -p rootpass -h localhost mydatabase < mydb.sql
    Code (markup):
     
    lachrymologist, Jan 4, 2012 IP
  10. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    This will not work with mydumper...

    I need it for mydumper...
     
    ASTRAPI, Jan 5, 2012 IP
  11. amigoserv.com

    amigoserv.com Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    
    mysql -uroot -p mydatabase < mydb.sql
    
    Code (markup):
    it will ask you about root password enter that and mydb.sql will be imported successfully

    Good Luck
     
    amigoserv.com, Jan 5, 2012 IP
  12. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    But this is not using the myloader that is part of mydumper that is better and faster :)
     
    ASTRAPI, Jan 5, 2012 IP
  13. lachrymologist

    lachrymologist Active Member

    Messages:
    456
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #13
    have you tried above command with myloader?
    try change the mysql part to myloader then put the options in the same order as above
     
    lachrymologist, Jan 7, 2012 IP