class_docstr: This handler handles connection and execution of the MySQL statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","MySQL","statements","."]
docstr: Receive SQL query and runs it
  :param query: The SQL query to run in MySQL
  :return: returns the records from the current recordset
docstr_tok: ["Receive","SQL","query","and","runs","it",":","param","query",":","The","SQL","query","to","run","in","MySQL",":","return",":","returns","the","records","from","the","current","recordset"]
code: def native_query(self, query: str) -> Response:
      """
      Receive SQL query and runs it
      :param query: The SQL query to run in MySQL
      :return: returns the records from the current recordset
      """
  
      need_to_close = self.is_connected is False
  
      connection = self.connect()
      with connection.cursor(dictionary=True, buffered=True) as cur:
          try:
              cur.execute(query)
              if cur.with_rows:
                  result = cur.fetchall()
                  response = Response(
                      RESPONSE_TYPE.TABLE,
                      pd.DataFrame(
                          result,
                          columns=[x[0] for x in cur.description],
                      ),
                  )
              else:
                  response = Response(RESPONSE_TYPE.OK)
          except Exception as e:
              logger.error(
                  f'Error running query: {query} on {self.connection_data["database"]}!'
              )
              response = Response(
                  RESPONSE_TYPE.ERROR, error_message=str(e)
              )
              connection.rollback()
  
      if need_to_close is True:
          self.disconnect()
  
      return response
  
imports: from collections import OrderedDict
  import pandas
  import mysql.connector
  from urllib.parse import urlparse
  from sqlalchemy import create_engine
  from mindsdb_sql import parse_sql
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
label_desc: Use image node_id 7 for calling the MySQLHandler obj's underlying member method code with example usage: obj.native_query(query) and returns: response