You have following password options:
- provide the password on the command line through the
- provide the password via the
MYSQL_PWD environment variable
- put your configuration in the
~/.my.cnf file under the
In all cases your client needs a plain text password to be able to authenticate. You mentioned hashes, but the trait of a hash is that it's a one way conversion function (i.e. you won't be able to restore the original password from a hash), therefore it's unusable as the authentication token.
Since you are backing up the Wordpress database from, allegedly, the same account that hosts your Wordpress there is no security improvements of trying to hide the password from the user that runs Wordpress (the database credentials can be easily extracted from the
wp-config.php file anyway).
So, I'd suggest to define the following
host = your_MySQL_server_name_or_IP
port = 3306
user = database_user_name
password = database_password
Then ensure that the file has the 0600 permissions. This way
mysqldump does not need any database credential specified on its command line (they will be read from the