I can't seem to be this working. I wanted to set a shell script for mysqldump backup some databases.

I have tried:

mysqldump -uroot -ppassword

mysqldump -u root -ppassword <-- online A's says this is supposed to work

mysqldump --user=root --password=password

I keep getting access denied for user root@localhost

if I do the old fashion mysqldump -uroot -p and enter pass all is good

centos 6.8 mysql 5.7 I did install mysql manually with: http://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/#

is there a mysql option that disables this?

  • 1
    and you are sure that you are entering the correct password?
    – Orphans
    Commented Jan 5, 2017 at 14:39
  • 3
    You shouldn't provide the password as a parameter in a script, it will be visible for everybody who runs ps while it is running. See this question and answer on how to provide the password in a secure way. Commented Jan 5, 2017 at 14:44
  • pass is correct, I know this isn't the best way but the reason I'm asking now is because it just doesn't work and I want to know why.
    – gstlouis
    Commented Jan 5, 2017 at 14:48
  • @GeraldSchneider mysql hides the password from ps
    – user9517
    Commented Jan 5, 2017 at 14:51

1 Answer 1


This works for me mysql -u bas -pmysecretpassword

if its for structrule use you can put your password in my.cnf file

like this :

  • Sorry submited to soon Commented Jan 5, 2017 at 18:07
  • That's a possibly useful answer, but 'structrule' is not a word, and I can't figure out what you might have intended it to be. Commented Jan 8, 2017 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .