SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Hybrid View

  1. #1
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with mySQL backup

    I have read som posts about this topic but I can't make it work.

    This is the code I try to use in myPHPadmin:

    mysqldump -hlocalhost -uUSERNAME -pPASSWORD -nDATABASENAME >./backup/backup.sql

    It don't work!! I want the file to be placed in the public_html/backup folder on my server.
    I use Hostrocket as a host.

    If I get this problem solved, how do I transfer the file to my hardisc?
    Since there is both text and images in the database I was wondering if I should use a ASCII or Binary transfer.
    I use a standard ftp program!

    What should I do when I want to upload the file again using myPHPadmin? What code?

    Thanks!

  2. #2
    SitePoint Enthusiast lieblick's Avatar
    Join Date
    Jun 2001
    Location
    Tallahassee, FL
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you can connect via shell ... that's what I'd do ...

    CD to your login directory /home/...

    From outside of mySQL type:
    mysqldump -u USERNAME -p DATABASENAME > blah.sql
    <passwd prompt>: PASSWORD

    The file should be located in whatever directory you're in ... then just ftp to the site and grab it on down!

    If you want to upload the file again, just upload it ...

    To restore a dump though, you may have to delete all of the information ...

    cat blah.sql | mysql -u USER -p DATABSENAME
    <passwd prompt>:PASSWORD

    Hope that helps some ...

  3. #3
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lieblick,
    Actually I would like to use the code in myPHPadmin, not trough telnet/shell!

    I know that making the backup inside myPHPadmin is not safe, but it should OK to use the mySQL commands. Or?

    Here is what I'd like to do:
    BACKUP
    - Execute a mysqldump command inside myPHPadmin
    - Download the file to my hardisc via FTP
    UPLOAD
    - Copy the code in the file into myPHPadmin and run it

    You don't say anything about ASCII or Binary. Does it not matter which I use?

    Thanks

  4. #4
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't execute any command like that in phpMyAdmin. You would need to use Telnet/SSH.
    Kevin

  5. #5
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK!

    Then I have to use telnet, wont I!!!
    Why isn't things easy.

    But what about that ASCII/Binary question?

    Thanks folks!!

  6. #6
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For a database dump, use ASCII.
    Kevin

  7. #7
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks tubedoggy!!!

  8. #8
    SitePoint Enthusiast lieblick's Avatar
    Join Date
    Jun 2001
    Location
    Tallahassee, FL
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've had basic experience with phpMyAdmin ... I used it once for a huge database replacement ... after which, I took the command set it gave me (it was kinda complicated) and saved it for future use from shell ...

    phpMYAdmin is nice ... but if you have access ... shell is the way to do it!

    Hope it works out ... it always does!

  9. #9
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hwo is it not safe to do a dump with phpmyadmin?

    unfortunately my new host doesn't allow shell access, so i can't use telnet for mysql commands.

    someone wanna tell me how in the heck i'm suppose to make a backup to store on my hdd with phpmyadmin?
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  10. #10
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Defender1
    hwo is it not safe to do a dump with phpmyadmin?

    unfortunately my new host doesn't allow shell access, so i can't use telnet for mysql commands.

    someone wanna tell me how in the heck i'm suppose to make a backup to store on my hdd with phpmyadmin?
    I tried to use phpmyadmin for backing up one of my databases. It did NOT work. The rest of my databases went well.

    For your question: I don't know!!! Try and see if it works.


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
  •