From e9f98c0efc8de619035c6c3bbd2673ddcd1f59b3 Mon Sep 17 00:00:00 2001 From: kustodian Date: Tue, 30 Sep 2014 00:22:02 +0200 Subject: [PATCH] mysql_replication should not connect to the 'mysql' database All the actions by the mysql_replication plugin can be done by connecting to the NULL database. There is no need to connect to the 'mysql' db, since there are permissions problems when connecting to remote hosts, e.g. when you want to query "SHOW MASTER STATUS" on a remote host. --- lib/ansible/modules/extras/database/mysql_replication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/database/mysql_replication.py b/lib/ansible/modules/extras/database/mysql_replication.py index d965f3ce0d4..1d61436a523 100644 --- a/lib/ansible/modules/extras/database/mysql_replication.py +++ b/lib/ansible/modules/extras/database/mysql_replication.py @@ -291,9 +291,9 @@ def main(): try: if module.params["login_unix_socket"]: - db_connection = MySQLdb.connect(host=module.params["login_host"], unix_socket=module.params["login_unix_socket"], user=login_user, passwd=login_password, db="mysql") + db_connection = MySQLdb.connect(host=module.params["login_host"], unix_socket=module.params["login_unix_socket"], user=login_user, passwd=login_password) else: - db_connection = MySQLdb.connect(host=module.params["login_host"], user=login_user, passwd=login_password, db="mysql") + db_connection = MySQLdb.connect(host=module.params["login_host"], user=login_user, passwd=login_password) except Exception, e: module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials") try: