mysqlcommand<\/a>. \u00a0The problem is that I can’t get MySQL to recognize the password. \u00a0I have no spaces after the “-p” however, I still get the following error:<\/p>\nmysqldump: Got error: 1045: Access denied for user ‘some_user’@’localhost’ (using password: NO) when trying to connect<\/p>\n
<\/p>\n
Solution<\/h2>\n No thanks to JustHost of course. \u00a0They don’t know why this doesn’t work as one support member tried to help me, but stopped replying after all his solutions failed and another support member just plain said “we do not provide support for this issue”.<\/p>\n
On to the solution. \u00a0The problem is that the mysql configuration file on JustHost is set to not supply a password no matter what you pass into the mysqldump command. \u00a0I’m not sure of the specifics of this so you can read more on configuration files if you need more details. \u00a0The key that clued me into the problem was a comment on this page. \u00a0 He had a similar problem to what I was having. \u00a0In the end my cnf file looked like below, named “mymysql.cnf”:<\/p>\n
<\/p>\n
[client]\n# The following password will be sent to all standard MySQL clients\npassword=\"thePassword\"<\/pre>\n <\/p>\n
And my bash file looked like so:<\/p>\n
#!\/bin\/bash\n\nmysqldump --defaults-file=\/somedir\/mymysql.cnf -u theusername thedbname > \/somedir\/thedbname`date +%d`.sql<\/pre>\n <\/p>\n
keywords: access denied using password NO \nsource: http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/option-files.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[2,6],"tags":[51],"yoast_head":"\nmysqldump - Using password: NO error - My Monkey Do<\/title>\n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n