input: Write a python function to connect to a MySQL database and perform CRUD operations.
  assert create_user(mydb, {'name': 'Alice', 'age': 30, 'email': 'alice@example.com'}) == {'message': 'user added successfully'}
  assert update_user(mydb, {'id': 1, 'name': 'Alice', 'age': 31, 'email': 'alice_new@example.com'}) == {'message': 'user record updated successfully'}
  assert delete_user(mydb, {'id': 1}) == {'message': 'user record deleted successfully'}
  assert get_users(mydb) == [(1, 'Alice', 31, 'alice_new@example.com')]
output: import mysql.connector
  
  def connect_to_db():
      return mysql.connector.connect(
          host="localhost",
          user="yourusername",
          password="yourpassword",
          database="yourdatabase"
      )
  
  def create_user(mydb, user_data):
      cursor = mydb.cursor()
      sql = "INSERT INTO users (name, age, email) VALUES (%s, %s, %s)"
      val = (user_data['name'], user_data['age'], user_data['email'])
      cursor.execute(sql, val)
      mydb.commit()
      return {'message': 'user added successfully'}
  
  def update_user(mydb, user_data):
      cursor = mydb.cursor()
      sql = "UPDATE users SET name=%s, age=%s, email=%s WHERE id=%s"
      val = (user_data['name'], user_data['age'], user_data['email'], user_data['id'])
      cursor.execute(sql, val)
      mydb.commit()
      return {'message': 'user record updated successfully'}
  
  def delete_user(mydb, user_data):
      cursor = mydb.cursor()
      sql = "DELETE FROM users WHERE id=%s"
      val = (user_data['id'],)
      cursor.execute(sql, val)
      mydb.commit()
      return {'message': 'user record deleted successfully'}
  
  def get_users(mydb):
      cursor = mydb.cursor()
      cursor.execute("SELECT * FROM users")
      result = cursor.fetchall()
      return result