input: Write a python function to connect to a MySQL database using configuration parameters and execute a given query.
  assert execute_query("SELECT 1", {"host": "localhost", "user": "user", "passwd": "password", "db": "test"}) == [(1,)]
  assert execute_query("SELECT 2", {"host": "localhost", "user": "user", "passwd": "password", "db": "test"}) == [(2,)]
  assert execute_query("SELECT COUNT(*) FROM information_schema.tables", {"host": "localhost", "user": "user", "passwd": "password", "db": "test"}) == [(0,)]
output: def execute_query(query, config):
      import mysql.connector
      connection = mysql.connector.connect(
          host=config["host"],
          user=config["user"],
          passwd=config["passwd"],
          database=config["db"]
      )
      cursor = connection.cursor()
      cursor.execute(query)
      result = cursor.fetchall()
      cursor.close()
      connection.close()
      return result