input: 
  from flask import Flask, jsonify, request
  from flask_mysqldb import MySQL
  
  app = Flask(__name__)
  
  # Mysql configuration
  app.config['MYSQL_USER'] = 'root'
  app.config['MYSQL_PASSWORD'] = 'password'
  app.config['MYSQL_DB'] = 'users'
  app.config['MYSQL_CURSORCLASS'] = 'DictCursor'
  
  mysql = MySQL(app)
  
  @app.route('/users', methods=['POST'])
  def create_user():
      name = request.json['name']
      email = request.json['email']
  
      cur = mysql.connection.cursor()
      cur.execute("INSERT INTO users (name, email) VALUES (%s, %s)", (name, email))
      mysql.connection.commit()
      cur.close()
  
      return jsonify({'message': 'User created'})
  
  @app.route('/users', methods=['GET'])
  def get_users():
      cur = mysql.connection.cursor()
      cur.execute("SELECT * FROM users")
      users = cur.fetchall()
      cur.close()
  
      return jsonify(users)
  
  @app.route('/users/<int:id>', methods=['GET'])
  def get_user(id):
      cur = mysql.connection.cursor()
      cur.execute("SELECT * FROM users WHERE id=%s", (id,))
      user = cur.fetchone()
      cur.close()
  
      return jsonify(user)
  
  if __name__ == "__main__":
      app.run(debug=True)
  """
  This script defines a REST API using Flask to handle user creation and retrieval. 
  It supports creating a user with a 'POST' request to '/users', retrieving all 
  users with a 'GET' request to '/users', and retrieving a single user by ID with a 
  'GET' request to '/users/<int:id>'.
  
  >>> from unittest.mock import MagicMock
  >>> class FakeMySQL:
  ...     def connection(self):
  ...         return self
  ...     def cursor(self):
  ...         return self
  ...     def execute(self, query, params=None):
  ...         self.query = query
  ...         self.params = params
  ...     def fetchall(self):
  ...         return [{'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}]
  ...     def fetchone(self):
  ...         return {'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}
  ...     def commit(self):
  ...         pass
  ...     def close(self):
  ...         pass
  >>> app.config['MYSQL_USER'] = 'fake_user'
  >>> app.config['MYSQL_PASSWORD'] = 'fake_pass'
  >>> app.config['MYSQL_DB'] = 'fake_db'
  >>> mysql = FakeMySQL()
  >>> app.testing = True
  >>> client = app.test_client()
  >>> response = client.post('/users', json={'name': 'Alice', 'email': 'alice@example.com'})
  >>> response.status_code == 200
  True
  >>> response = client.get('/users')
  >>> response.json == [{'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}]
  True
  >>> response = client.get('/users/1')
  >>> response.json == {'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}
  True
  """
  
output:     
  @app.route('/users/<int:id>', methods=['PUT'])
  def update_user(id):
      name = request.json['name']
      email = request.json['email']
  
      cur = mysql.connection.cursor()
      cur.execute("UPDATE users SET name=%s, email=%s WHERE id=%s", (name, email, id))
      mysql.connection.commit()
      cur.close()
  
      return jsonify({'message': 'User updated'})
  
  @app.route('/users/<int:id>', methods=['DELETE'])
  def delete_user(id):
      cur = mysql.connection.cursor()
      cur.execute("DELETE FROM users WHERE id=%s", (id,))
      mysql.connection.commit()
      cur.close()
  
      return jsonify({'message': 'User deleted'})
  