input: Write a python function to insert data into a MySQL table.
  assert insert_data({"field1": "value1", "field2": "value2"}) == "Success!"
  assert insert_data({"field1": "test1", "field2": "test2"}) == "Success!"
output: def insert_data(data):
      import mysql.connector
      try:
          # Establish a database connection
          connection = mysql.connector.connect(
              host="your_host",
              user="your_username",
              password="your_password",
              database="your_database"
          )
          cursor = connection.cursor()
          
          # Create an insert query dynamically based on data keys and values
          fields = ', '.join(data.keys())
          placeholders = ', '.join(['%s'] * len(data))
          query = f"INSERT INTO your_table ({fields}) VALUES ({placeholders})"
          values = tuple(data.values())
          
          cursor.execute(query, values)
          connection.commit()
          
          cursor.close()
          connection.close()
          
          return "Success!"
      except mysql.connector.Error as err:
          return f"Error: {err}"