mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-04 05:04:23 -07:00
mysql_user: enabled autocommit to support MySQL 8
This commit is contained in:
parent
3ff1fad5f3
commit
56478f4d10
1 changed files with 2 additions and 2 deletions
|
@ -433,13 +433,13 @@ def main():
|
|||
if check_implicit_admin:
|
||||
try:
|
||||
cursor, db_conn = mysql_connect(module, "root", "", config_file, ssl_cert, ssl_key, ssl_ca, db,
|
||||
connect_timeout=connect_timeout, check_hostname=check_hostname)
|
||||
connect_timeout=connect_timeout, check_hostname=check_hostname, autocommit=True)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if not cursor:
|
||||
cursor, db_conn = mysql_connect(module, login_user, login_password, config_file, ssl_cert, ssl_key, ssl_ca, db,
|
||||
connect_timeout=connect_timeout, check_hostname=check_hostname)
|
||||
connect_timeout=connect_timeout, check_hostname=check_hostname, autocommit=True)
|
||||
except Exception as e:
|
||||
module.fail_json(msg="unable to connect to database, check login_user and login_password are correct or %s has the credentials. "
|
||||
"Exception message: %s" % (config_file, to_native(e)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue