Take the 2-minute tour ×  I have a MySql database that I want to
backup to a file daily. (Which I will later download for off-
server backup).  I have set up the following command in my
crontab (ran daily):  mysqldump -–opt -Q -h [myhost] -u
myusername -–password=***** ebooklibrary >
/fullpath.../_db_backups/openelibrary.sql  The database name is
ebooklibrary.  I am constantly getting this error:  mysqldump:
Got error: 1045: Access denied for user 'myusername'@'' (using
password: NO) when trying to connect  How can I fix this, or do
it properly, so that mysqldump will run daily?   Using the
shell, the following command worked:   mysql -h myhost -u
myusername -p"*****" ebooklibrary share|improve this question
Giving passwords in the command line is insecure, it is more
secure to add it to my.cnf [client] secion. See
dev.mysql.com/doc/refman/5.5/en/password-security-user.html – 
Stone Feb 19 at 12:41 add comment  3 Answers  up vote 3 down
vote accepted  I believe the matter is with how you specify the
password.