mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 20:54:25 -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:
|
if check_implicit_admin:
|
||||||
try:
|
try:
|
||||||
cursor, db_conn = mysql_connect(module, "root", "", config_file, ssl_cert, ssl_key, ssl_ca, db,
|
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:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if not cursor:
|
if not cursor:
|
||||||
cursor, db_conn = mysql_connect(module, login_user, login_password, config_file, ssl_cert, ssl_key, ssl_ca, db,
|
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:
|
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. "
|
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)))
|
"Exception message: %s" % (config_file, to_native(e)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue