diff --git a/salt/_modules/so.py b/salt/_modules/so.py index a15e7ee66..2356f68da 100644 --- a/salt/_modules/so.py +++ b/salt/_modules/so.py @@ -24,12 +24,14 @@ def mysql_conn(retry): for i in range(0, retry): log.debug(f'Connection attempt {i+1}') try: - _mysql.connect( + db = _mysql.connect( host=mainip, user='root', passwd=__salt__['pillar.get']('secrets:mysql') ) - log.debug(f'Connected to MySQL server on {mainip} after {retry} attempts.') + log.debug(f'Connected to MySQL server on {mainip} after {i} attempts.') + db.query("""SELECT 1;""") + log.debug(f'Successfully completed query against MySQL server on {mainip}') mysql_up = True break except _mysql.OperationalError as e: