{"library":"mysql","title":"Virtual Package for MySQL-python (Deprecated)","description":"The `mysql` package on PyPI is a virtual package, currently at version 0.0.3. It does not provide actual MySQL connectivity. Its primary purpose, especially for version 0.0.3, is to raise a `RuntimeError` upon installation or import, directing users to install proper MySQL client libraries like `mysqlclient` or `PyMySQL` directly. It has a very slow release cadence, with the last update in May 2021, and serves as a placeholder to guide users away from outdated dependencies.","language":"python","status":"deprecated","last_verified":"Wed Apr 15","install":{"commands":["pip install mysql"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# The 'mysql' package (0.0.3) does not provide a functional API.\n# It will raise a RuntimeError upon import or use, directing you to install\n# 'mysqlclient' or 'PyMySQL' instead.\n# For example, to use mysqlclient:\n# pip install mysqlclient\n# import MySQLdb\n# conn = MySQLdb.connect(host='localhost', user=os.environ.get('MYSQL_USER', 'user'), password=os.environ.get('MYSQL_PASSWORD', 'password'), database=os.environ.get('MYSQL_DATABASE', 'test_db'))\n# cursor = conn.cursor()\n# cursor.execute('SELECT VERSION()')\n# print(cursor.fetchone())\n# conn.close()\n\n# Or to use PyMySQL:\n# pip install PyMySQL\n# import pymysql\n# connection = pymysql.connect(host='localhost', user=os.environ.get('MYSQL_USER', 'user'), password=os.environ.get('MYSQL_PASSWORD', 'password'), database=os.environ.get('MYSQL_DATABASE', 'test_db'))\n# with connection.cursor() as cursor:\n#     cursor.execute('SELECT VERSION()')\n#     print(cursor.fetchone())\n# connection.close()","lang":"python","description":"The `mysql` package itself does not offer a quickstart because its intended behavior is to prevent usage and guide developers to a suitable, actively maintained MySQL connector. The code provided illustrates the typical usage patterns for recommended alternatives like `mysqlclient` (which uses `MySQLdb` for imports) or `PyMySQL`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}