How do I back up my database SQL?

Discussion in 'MySQL' started by OreoKnight, Feb 12, 2008.

  1. #1
    Just wondering how I would go about backing up my database. I use hostgator. Check my sig for the site to help with these other questions.

    Other questions:
    1) After you select a subdir for articles is shows them in the order of oldest to newest. How do I change that?
    2) Is there a way to insert links into the script which creates the navbar on the left (check the source code)
    3) Can I hide navbar links so I create content in a certain category but not have it listed on the main page (as to create artificial subcategories)

    Your help is GREATLY appreciated.
     
    OreoKnight, Feb 12, 2008 IP
  2. OreoKnight

    OreoKnight Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    OreoKnight, Feb 12, 2008 IP
  3. roseau

    roseau Peon

    Messages:
    266
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just login to your phpadmin and find the database name, then export it to your hard drive. You will then have a current copy of your DB
     
    roseau, Feb 12, 2008 IP
  4. mjesales

    mjesales Peon

    Messages:
    326
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i use sqldumper.de (free) it worked great on my site. But if you have a small enough thing you can just do it through phpmyadmin
     
    mjesales, Feb 26, 2008 IP
  5. Whippet75

    Whippet75 Well-Known Member

    Messages:
    1,599
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    155
    #5
    I also use sqldumper...fantastic little script ;)
     
    Whippet75, Feb 26, 2008 IP
  6. j0ned

    j0ned Active Member

    Messages:
    684
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #6
    z0mg.. at command prompt:

    mysqldump --add-drop-table -h your.db.hostname.net -u root -p password > entire.database.back.sql
    Code (markup):
    done. why use a script? LOL
     
    j0ned, Feb 26, 2008 IP
  7. crumblepie

    crumblepie Well-Known Member

    Messages:
    2,612
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    160
    #7
    Like roseau said, just go to phpadmin, click export then select .sql and click 'go'. It will save it as a .sql file. You can then import this .sql file into any database you want to be able to use it (or simply save it for backup purposes). I hope this helps :)
     
    crumblepie, Feb 26, 2008 IP
  8. zYm3N

    zYm3N Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I suggest running mysqldump utility via crontab (linux) or schedule (windows). It gives you comfort of having last 5-10 days database backup. Sometimes it's very helpful.
     
    zYm3N, Feb 27, 2008 IP
  9. jamesmoey

    jamesmoey Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Command line is the best way, go and get a SSH access.
    phpmyadmin is unreliable if you have a huge database/table.
     
    jamesmoey, Feb 27, 2008 IP
  10. amIT29

    amIT29 Banned

    Messages:
    229
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I have been using phpadmin works fine for me.........
    command is better though....

    if dont know how to use....phpadmin etc...pm me i will tell u :)
     
    amIT29, Feb 27, 2008 IP
  11. Petey

    Petey Peon

    Messages:
    68
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hi OreoKnight,

    I use Amanda open source backup (http://amanda.zmanda.com/) to take daily remote backups. The setup isn't too hard and you can just add it to cron and forget it.

    Petey
     
    Petey, Feb 28, 2008 IP
  12. j0ned

    j0ned Active Member

    Messages:
    684
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #12
    Petey,

    If you can add a cron job to "Amanda" why not just use the utility that comes with MySQL? What's the purpose of installing another piece of software if mysqldump is fully capable of achieving the same thing?

    -j0ned
     
    j0ned, Feb 28, 2008 IP
  13. Petey

    Petey Peon

    Messages:
    68
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hi j0ned,

    I use Amanda because I want to manage daily, weekly, monthly backups across a number of servers from a single backup server. All of the crontab entries are made in the backup server rather than spread across the individual database servers. Amanda lets me set this up easily and I can do useful stuff like set data retention policies.

    And (because I am slightly paranoid :D) I use rsync to transfer the backup directories onto yet another server.

    This time last year I was just doing mysqldumps but that was before one of my ISPs had two disks fail in a RAID 5 array :mad:

    Petey
     
    Petey, Feb 28, 2008 IP
    j0ned likes this.
  14. j0ned

    j0ned Active Member

    Messages:
    684
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #14
    Aaahh! So you've got a pretty large operation going on :) I can relate on the slight paranoia, I'm the same way. Thanks for answering my questions - makes total sense.
     
    j0ned, Feb 28, 2008 IP
  15. awatson

    awatson Active Member

    Messages:
    112
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #15
    I like to use mysqldump via ssh - you can set up a cron job to make a backup every night if you want.
     
    awatson, Feb 29, 2008 IP
  16. ag3nt bi0s

    ag3nt bi0s Banned

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #16
    i too use shell..........thats the best way :D
     
    ag3nt bi0s, Feb 29, 2008 IP