The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any quick way to backup all clients mysql

Discussion in 'General Discussion' started by albertg, Sep 18, 2002.

  1. albertg

    albertg Well-Known Member
    PartnerNOC

    Joined:
    Sep 4, 2002
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Hello People.

    May i ask whether is there any quick way to backup all client mysql db?

    Any assistance is very much appreciated.
     
  2. thomas

    thomas Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    All db's are stored in: /var/lib/mysql/

    Just make a backup of that dir.
     
  3. BJMG

    BJMG Active Member

    Joined:
    Jul 24, 2002
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    you may also want to checkout http://www.phpmybackup.com/
     
  4. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    mysqldump -A & all-mysql-dbs.sql

    This will create one file on your server called all-mysql-dbs.sql and it will contain every database inside.

    Just fyi, to restore individual db's via this file is kind of a pain in the ass because this file has every db in it. If you wanted seperate .sql files you could do somthing like this.

    for i in `mysql -e &show databases&`;do echo &Backing Up $i&;mysqldump $i & $i.sql;done

    It will give a error in the beggining saying &mysqldump: Got error: 1049: Unknown database 'Database' when selecting the database& Ignore that... i could chop off the first line i guess :)
     
Loading...

Share This Page