SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysqldump not working

    Hi,

    I was wondering if someone could point out something I am not seeing here. I have been trying to do a database dump without success.

    I have tried, "mysqldump db_name", "mysqldump db_name > db_name.sql", "mysqldump --databases db_name", etc etc, but always get a syntax error. I have searched the forum and found a few other people with the same problem but not a sufficient answer.

    I am using MySQL 4.0.14 on my own testing server, logged in as the root user.
    Is there something I am doing wrong?

    Thanks in advance for the help
    Mike M

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2005
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would you plz put the error in here?

    Chagh

  3. #3
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you were going along the right lines with this one...

    mysqldump db_name > db_name.sql"

    try putting your username and password into the command...

    mysqldump -uusername -ppassword database_name > filename.sql

    Remeber to leave no spaces between -u and your username, and -p and your password.

    Tryst

  4. #4
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    thanks for the help guys.
    The error message was just the general syntax error, and points to the very start of my command ie "error: check your syntax after 'mysqldump ....'".

    I did try using my username and password as well, and get the same error. Not sure why.

    Any other suggestions?

    Thanks
    Mike

  5. #5
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    are you doing this from your OS prompt or in the mysql client? because you should be doing this from your OS prompt.

  6. #6
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    yeah, this is what I am typing in my OS prompt,
    "c:\mysql\bin\mysqldump.exe" -uroot -ppassword --databases db_name > c:\myfolder\db_backup

    which has actually running for me, and a window opens with what appears to be the dump output being displayed, but then when I check the folder I specified for the file to be saved, there is nothing to be found.

    Sorry, I know I must not be doing something correctly here, I am just not that experienced in doing it. Any help is greatly appreciated.

    Thanks
    Mike

  7. #7
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    take away the .exe and put a .sql after the file name you want to dump to.

    Tryst

  8. #8
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks,
    but sorry still no file to be found. The dump seems to be running as the screen is popping up and all the output being spit back at me, but it just isnt being saved to a file.

  9. #9
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you can't use pipes and redirects in the run dialog box. you have to do it from an actual command prompt.

  10. #10
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks longneck, you are the man, that did the trick.

    Mike


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
  •