mysqldump password options?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smestas
    Member
    • Nov 2002
    • 76

    mysqldump password options?

    Is it possible to get the DB user name, DB name, and password into one line. Its funny because all of the documentation that I see the -p is for password but everyone uses it for the DB name. Im confused? I can do manuall DBdumps via SSH but Im trying to set up a CRON job and it keeps getting hung up on the password part of the line Im giving it to run. Heres a example of what Im trying.

    mysqldump --opt -Q -u myusername -p myforumdatabase mypassword> /my/file.sql

    Can anyone give me the correct type to insert for a no password asking mysqldump? If I can get that working via SSH then I think I can make it work in my CRON tab manager.

    Regards,
  • smestas
    Member
    • Nov 2002
    • 76

    #2
    Basically I just want to know if you can do a mysqldump without being prompted for the database password by placing it in the original line the first time around?

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      mysqldump --opt -Q -u myusername -pPASSWORDHERE myforumdatabase > /my/file.sql


      Comment

      • smestas
        Member
        • Nov 2002
        • 76

        #4
        Thanks Zachery!!!!!!

        I was stuck on this for hours.

        I actually tried it like that but I had a space between -p MYPASSWORD instead of -pMYPASSWORD like you posted. I never knew it mattered.

        Thanks again!!!

        Comment

        • techtir
          New Member
          • Sep 2009
          • 5
          • 3.8.x

          #5
          You might need host option on some providers if SQL server is a different box

          mysqldump -h SQLHOSTSERVER -u USERNAMEOFDATABASE -p******** DATABASE > ~/FILEPATHNAME

          ****** = password of database/user

          ~ means path to the user's Directory incase mysqldump needs a full path and you don't know where you are!
          FILEPATHNAME If this includes any directories, create them first.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...