how do I backup mysql db?

Discussion in 'OT Technology' started by Leb_CRX, Mar 20, 2004.

  1. Leb_CRX

    Leb_CRX OT's resident terrorist

    Joined:
    Apr 22, 2001
    Messages:
    39,994
    Likes Received:
    0
    Location:
    Ottawa, Canada
    anyone have a link to a website which explains it? no idea what the commands are, etc, I just need to backup before I get pwned again...I did a search on google, could not find anything relevant, keeping in mind I have never done this :hs:
     
  2. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    Make a backup copy of a whole database
    mysqldump --opt db_name > backup-db_name.sql
     
  3. Leb_CRX

    Leb_CRX OT's resident terrorist

    Joined:
    Apr 22, 2001
    Messages:
    39,994
    Likes Received:
    0
    Location:
    Ottawa, Canada
    Thanks man :bigthumb:

    ok so it gets saved to the backup-db_name.sql

    now in case I ever have to restore it, how do I go about doing that?

    also how can I add accounts to my DB?
     
  4. Leb_CRX

    Leb_CRX OT's resident terrorist

    Joined:
    Apr 22, 2001
    Messages:
    39,994
    Likes Received:
    0
    Location:
    Ottawa, Canada
    oh ya I also want to check I did this cron job right, I am not too understanding of crons but from what i've gathered from man and google, I put a file called mysqlBackup in /etc/cron.daily and I made it executable (even ran it to make sure it worked)...is there anything else I need to do or will the cron job automaticaly see the file there and run it, or do I have to add it into any lists or anything? :hs:
     
  5. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    Google up "crontab". Running crontab -e will allow you to edit your cronjobs with VI. You need to set it up to run whoever often you want.
     

Share This Page