Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#29 add .my.cnf as a choice for mysql credentials

Unstable (example)
open
nobody
None
5
2014-05-11
2013-08-08
Jim Cooley
No

If you check configuration files into a repository, you'll needed a way to keep the username and password out of the configuration file. One way to do this is to take advantage of the ~/.my.cnf used by mysql and mysqldump by default.

With this patch you can set
CONFIG_mysql_dump_use_mycnf_for_userpass='yes'

And automysqlbackup will use the username and password specified in the ~/.my.cnf of the user running the script.

Example ~/.my.cnf:
# This will be passed to all mysql clients
[client]
socket = /var/run/mysqld/mysqld.sock
user=dbuser
password=dbpassword

1 Attachments

Discussion

  • Klintrup
    Klintrup
    2014-05-11

    Nice patch,

    I added to option to specify an additional my.cnf so you don't have to use the defaults and redid the patch, hope someone can use it.

    This is especially useful for mysql 5.6.9 and later, as it will print a warning that --password shouldn't be used from the commandline, and backups won't be seen as completed.

    Also be sure to use [client] and not [mysqldump] in my.cnf/.my.cnf as this will cause database backups to fail silently.

     
    Last edit: Klintrup 2014-05-11
    Attachments