MySQL Backup 1.2 (MySQL 5.5+)

In the previous versions of this script you’ve had to leave the backup user password in the script, however MySQL 5.5 and above come with mysql_config_editor which allows you to store connection details in an ancryptedl file (~/.mylogin.cnf) which mysql/mysqldump/mysqladmin can use with the “--login-path=” option.

For basic usage run the following, the --password prompts for the password rather than having to specify it on the command line

mysql_config_editor set --login-path=local --host=localhost --user=db_user --password

Once you’ve done this you can then have the utility login with –login-path=local Of course you can run this multiple times and set up multiple remote servers.

So in version 1.1 of the script you can just change the USEROPTIONS variable like this:

USEROPTIONS="--login-path=local"