SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Dump a database

  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    everywhere I've seen how to backup a database, but how do you restore one.

    PhpMyADmin is refusing to restore it and was wondering if there was another way?

    thanx

    Peter

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    phpMyAdmin is weird sometimes

    here's the trick.. open up the SQL dump you had from phpMyAdmin, copy it into the clipboard, and then paste it in the query window for the specific database... do all this INSTEAD of uploading the file via phpMyAdmin .. and that way it should dump it more efficiently

    your second option is dumping it via shell

    mysql -u USERNAME -p DBNAME < file.sql
    cogito, ergo sum

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My PC crashes sometimes when i try to copy the file: it is 495 pages or 800,000 characterss...AHHH.....

    I'm trying to do the shell thing except i found it doesn't work. Shell i mean. I don;'t have access to shell....

    I'll try copying again

    Peter

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pete-
    To restore a database all you need to do is the following command.

    mysql -uusername -ppassword database < backedupfile.sql

    HTH
    Steven
    Have you ever been ripped off, lied to or cheated? If so, check out
    Baddealings.com

  5. #5
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That's assuming you either have telnet/SSH access to your server, or your MySQL server allows you to connect directly from your own computer (in which case you'd install the 'mysql' program on your own computer and run it with the --host parameter).
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, kyank is right. However, I know that pete has SSH/telnet access because we have the same host.
    Have you ever been ripped off, lied to or cheated? If so, check out
    Baddealings.com


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
  •