I wrote a simple shell script to dump a specific mysql database. problem is it is prompting me for a password even though I provide on. The mysql db is version 5.0.27 if that matters. Here is the specific line I am using.
$MYSQLDUMP -u backup -p$MyPass $DB > $DEST/$FILE
I tried several variations, but to no avail.
aoeu1234, my config file haspassword = 'aoeu1234'; otherwise you'll get an unauthorized error. – Damon Jul 23 '14 at 21:19'yourpwd\'withatick'. See this answer for more character escapes. You can test it by using plain mysql to connect, such asmysql --defaults-extra-file=db.cnfbut you'll need db.cnf to be mode 700 (rwx --- ---) or stronger on Linux, or 400 (r-- --- ---) if stored on NTFS but ran from Linux, otherwise you'll get an error that it's "World-writeable". NTFS on Windows may need restricted ownership as well, I'm not sure. – Damon Jan 15 '15 at 19:14mysql ... --password hunter2and someone else on the system can runps axfwwthen they will see the password since that ps command will print the full command line. – Zoredache Jan 15 '15 at 19:20--passwordonly, and it would prompt you for the password. Then you type the password in. In this way how couldps axfwwwork? – Pacerier Jan 16 '15 at 07:07