code: def get_mysql_connection(host, user, port, password, database, ssl={}):
      
  
      return pymysql.connect(host=host,
                             user=user,
                             port=port,
                             password=password,
                             db=database,
                             charset='utf8mb4',
                             cursorclass=pymysql.cursors.DictCursor,
                             client_flag=pymysql.constants.CLIENT.MULTI_STATEMENTS,
                             ssl=ssl
                             )
docs: MySQL connection