SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Backing Up SQL

Hybrid View

  1. #1
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Howdy,

    I'm trying to backup and SQL database (for a copy of vBulletin), and need to restore it later.

    I read through Kevin's tutorial on the subject, but am a bit confused: where exactly does it go when I save it? I couldn't figure it out. I probably sound like a moron to some of the more experienced people here, but I can handle that if I can figure out how this is done.

    Also: is it safe, and reliable? Losing the posts/threads on the forum would be a disaster.

  2. #2
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chris, check out my articles on that very thing at http://www.webdevsites.com/articles/article13.php

    hope it helps

    rgds,

  3. #3
    psycho
    Join Date
    May 2000
    Location
    London
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    easiest way is to go into phpmyadmin, and go to "dump"..check the check box saying "send" and it will send you a file which can recreate all tables and all data in them

    J

  4. #4
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'd just like to add that sometimes phpmyadmin has a hard time accepting large dump files, in which case you'd have to upload and reload the db to the server via telnet

    ------------------------
    SitePoint Community Moderator
    myONLYhost.com: when you want something MORE

  5. #5
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I use in crontab:

    mysqldump --opt --user=oops --password=shouldntsay dbName > /path/filename.whatever

    Hope it helps!
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  6. #6
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I recently had to switch from the phpMyAdmin method to the telnet method because my database became too big - it would time out when sending the dump due to PHP's Max Execution Time. My DB is about 3mb now I think - still pretty small but growing daily

  7. #7
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never tried to use phpMyAdmin, since it wouldn't work anyway
    My backup file is 30MB now and grow by 4-5MB each day!
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Twtcommish if you use telnet then your mysqldump dbname > whatever.sql would end up in the directory you ran the command from so if you telnet in and you are in

    /home/www/twtcommish for example the file would be copied to /home/www/twtcommish/whatever.sql
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  9. #9
    SitePoint Zealot Jppr's Avatar
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's wrong with

    shell> mysqldump database_name > c:\backups\dbdecember.sql

    ? That's the most logical no, or are there some drawbacks?

  10. #10
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm honestly not getting this - I've tried the code here, and code like Kevin's, and it's simply not working. I'm getting the standard SQL error.

  11. #11
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where are you doing it from the shell prompt or the mysql prompt. You need to be at the shell prompt not in mysql itself. so once you telnet in you simply type
    $>mysqldump -u username -p dbname > /pathto/textfiletoexportto
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •