input: Write a python function to create and check a MySQL connection.
  assert create_and_check_connection('localhost', 'test_db', 'root', 'password')== "Connection established successfully"
  assert create_and_check_connection('localhost', 'nonexistent_db', 'root', 'wrong_password')== "Failed to establish connection"
output: def create_and_check_connection(host, database, user, password):
      import mysql.connector
      from mysql.connector import Error
      
      try:
          connection = mysql.connector.connect(
              host=host,
              database=database,
              user=user,
              password=password
          )
          if connection.is_connected():
              connection.close()
              return "Connection established successfully"
      except Error as e:
          return "Failed to establish connection"