input: Write a Python function to parse an HTML table from a given URL and store its data into a MySQL database.
  assert parse_and_store_table('http://example.com') == "Data inserted successfully"
  assert parse_and_store_table('http://anotherexample.com') == "Data inserted successfully"
output: def parse_and_store_table(url):
      import requests
      from bs4 import BeautifulSoup
      import mysql.connector
      from mysql.connector import Error
      
      try:
          # Send a request to the URL
          response = requests.get(url)
          response.raise_for_status()
          
          # Parse the HTML content
          soup = BeautifulSoup(response.content, 'html.parser')
          table = soup.find('table')
          
          # Extract table headers
          headers = [header.text for header in table.find_all('th')]
          
          # Extract table rows
          rows = []
          for row in table.find_all('tr')[1:]:  # Skip the header row
              cols = row.find_all('td')
              rows.append([col.text for col in cols])
          
          # Establish connection to MySQL database
          connection = mysql.connector.connect(
              host='your_mysql_host',
              user='your_mysql_user',
              password='your_mysql_password',
              database='your_database_name'
          )
          
          if connection.is_connected():
              cursor = connection.cursor()
              
              # Create table if it doesn't exist
              table_name = 'html_table'
              create_table_query = f"""
              CREATE TABLE IF NOT EXISTS {table_name} (
                  {', '.join([f'{header} TEXT' for header in headers])}
              )
              """
              cursor.execute(create_table_query)
              
              # Insert data into the table
              insert_query = f"""
              INSERT INTO {table_name} ({', '.join(headers)})
              VALUES ({', '.join(['%s'] * len(headers))})
              """
              for row in rows:
                  cursor.execute(insert_query, row)
              
              # Commit the transaction
              connection.commit()
              return "Data inserted successfully"
      
      except requests.exceptions.RequestException as e:
          return f"Error fetching URL: {e}"
      except Error as e:
          return f"Error connecting to MySQL: {e}"
      finally:
          if connection.is_connected():
              cursor.close()
              connection.close()