Skip to content

Commit 9a5bd85

Browse files
committed
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.
1 parent d2d0ed2 commit 9a5bd85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database/mysql_replication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ def main():
291291

292292
try:
293293
if module.params["login_unix_socket"]:
294-
db_connection = MySQLdb.connect(host=module.params["login_host"], unix_socket=module.params["login_unix_socket"], user=login_user, passwd=login_password, db="mysql")
294+
db_connection = MySQLdb.connect(host=module.params["login_host"], unix_socket=module.params["login_unix_socket"], user=login_user, passwd=login_password)
295295
else:
296-
db_connection = MySQLdb.connect(host=module.params["login_host"], user=login_user, passwd=login_password, db="mysql")
296+
db_connection = MySQLdb.connect(host=module.params["login_host"], user=login_user, passwd=login_password)
297297
except Exception, e:
298298
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials")
299299
try:

0 commit comments

Comments
 (0)