Do not pass MySQL DB server credentials directly but pass them using a file

In mysql and mysqldump binaries there is an option named:

--defaults-extra-file
which allows passing the credentials to a database server using a configuration file. Example:
mysql --defaults-extra-file=/etc/config_db0.cnf ...
mysqldump --defaults-extra-file=/etc/config_db0.cnf ...
This configuration file (/etc/config_db0.cnf) can have the following structure:
[client]
user={{ db_username }}
password={{ db_password }}
host={{ db_hostname }}
Working example of this file:
[client]
user=scripts
password=VerySecure123
host=db.domain.tld