SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Dumping MySQL

  1. #1
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dumping MySQL

    I love backups, gotta have backups, cant sleep at night without backups so has anybody ever tried the following or have any suggestions on how to achieve this :

    I have a web host that very nicely provides me with ZIP format backups of the site, the problem is 90% of my site is database driven and the contents of the database is not included in the backup. So if MySQL dies so does my site

    What I want to do is setup a cron job to dump the contents of the database to XYZ.SQL and then email that file to me.

    I have seen this "dumping" facility in PHPMYADMIN, and I have spent the last few hours trying to decifer how it works to no avail

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DB dumping in phpmyadmin is fairly simple. On front page of your DB simply go to "View dump(schema)" click the structure and data radio button and check the send and complete inserts checkboxes and hit go. This will download an .sql file to your HD.

    As for setting it up on a cron job and email the files, pass. I tend to just go in once a week ish and dump the DB manually -- I have 5 and it only takes 10 mins or so. My host also backs up the DB daily -- have you tried contacting them to find out how they back up the DB's?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    I LOVE THIS SITE ! ! ! DougD's Avatar
    Join Date
    May 2000
    Location
    San Diego, CA
    Posts
    463
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow... that was easy! I was trying to find out how to backup my databases with phpMyAdmin and did a quick "search for" in the php forum and I found this thread (awesome).

    OK... I backed it up and it was super simple... Now the question... What if I lost my whole database (I hope I never do)... how would I re-install the file I saved back to my server?

    Thanks in advance...

  4. #4
    SitePoint Addict eddiembabaali's Avatar
    Join Date
    Mar 2001
    Location
    USA, Philadelphia
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just cut and paste your XYZ.SQL into the text area that says " Run SQL query/queries on database YOUR_DATABASE_NAME " click GO and you should be in business.
    cd pub \r; more beer

    Eddie

  5. #5
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only thing I would say that dumping via phpmyadmin is not always reliable. I recently had to switch hosts, did the dump from phpmyadmin on old host, and upload to new host via phpmyadmin and one of them didn't like it.

    The BEST way to do it is with shell access using mysqldump.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  6. #6
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh and eddie, you don't need to cut and paste, just hit the browse button and select the .sql file from your harddrive. But mysqldump is much better
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  7. #7
    SitePoint Addict eddiembabaali's Avatar
    Join Date
    Mar 2001
    Location
    USA, Philadelphia
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I host my sites with different hosts and one of them still uses the old phpmyadmin that does not support browsing for files. I guess if his host does then so much the better for him. Out of curisity does anyone know the query executed to create a dump(schema)? I just hate clicking away without knowing whats going on .
    cd pub \r; more beer

    Eddie

  8. #8
    I LOVE THIS SITE ! ! ! DougD's Avatar
    Join Date
    May 2000
    Location
    San Diego, CA
    Posts
    463
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Guys...

    I did the "browse" method and it worked like a charm. To test it I just created a new database... renamed the file to match the new database and uploaded it... PERFECT!

    Thank-you very much! (I LOVE LEARNING!)...

  9. #9
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by eddiembabaali
    Out of curisity does anyone know the query executed to create a dump(schema)?
    http://www.mysql.com/doc/m/y/mysqldump.html
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  10. #10
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by eddiembabaali
    I host my sites with different hosts and one of them still uses the old phpmyadmin that does not support browsing for files. I guess if his host does then so much the better for him. Out of curisity does anyone know the query executed to create a dump(schema)? I just hate clicking away without knowing whats going on .
    You know you CAN download and install the new phpMyAdmin yourself and install it. It's just a bunch of PHP files. You'll have to add some kind of password protection, maybe through .htaccess, but you can do it.

    Sketch
    Aaron Brazell
    Technosailor




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •