Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQLDUMP

Status
Not open for further replies.

Zugdud

IS-IT--Management
Feb 26, 2003
158
US
Howdy, Is there a way to specifiy a password with mysqldump? I would like to add a few mysqldump commands to a cron but can't seem to figure out a way to schedual them without direct user input of the password

mysqldump -h mysql.yourdomain.com -u user -p dbname > /home/user/mybackup.sql

I imagine there has to be a way to do this, thanks for any help!
 
Invoking

mysqldump --help

at the command-line will tell you lots about the program's input options. Among them is "--password=[password]"


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks, well I did end up trying a few varients with -p, -password, etc. But didn't have any luck, When I run this:

mysqldump -h mysql.yourdomain.com -u user -p=password dbname > /home/user/mybackup.sql

It says password YES but permission is denied (even though the password is correct...)

Tried this and it doesnt seem to run correctly (password NO)

mysqldump -h mysql.yourdomain.com -u user -p password dbname > /home/user/mybackup.sql

Also tried this without any luck

mysqldump -h mysql.yourdomain.com -u user -password password password dbname > /home/user/mybackup.sql
 
Ahhh NM, there is suppose to be no space between -p and the passsword

so

mysqldump -h mysql.yourdomain.com -u user -ppassword dbname > /home/user/mybackup.sql
 
Right. you need to learn to read the usage messages correctly. It's either --password=yourpassword or -pyourpassword, as you figured out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top