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.
pip install mysqlNo compatibility data collected yet for this library.
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`.
Do not depend on `mysql`. Instead, install and use `mysqlclient` (for C-extension based driver, `pip install mysqlclient`) or `PyMySQL` (for pure Python driver, `pip install PyMySQL`).
Always explicitly choose and install a maintained MySQL connector like `mysqlclient` or `PyMySQL`. Check their respective PyPI pages and documentation for current installation and usage instructions.
Update `requirements.txt` or `pyproject.toml` to directly list `mysqlclient` or `PyMySQL` as dependencies.
For Python 3, use `mysqlclient` or `PyMySQL`. If you strictly require `MySQL-python` (e.g., for a legacy Python 2 application), ensure your environment is Python 2 compatible and understand that `MySQL-python` is not actively developed.
Install a proper MySQL client library such as 'mysql-connector-python', 'mysqlclient', or 'PyMySQL' (e.g., `pip install mysql-connector-python`).
After installing a proper MySQL client (e.g., `pip install mysql-connector-python`), import the specific connector module (e.g., `import mysql.connector`).
Install the MySQL development headers specific to your operating system. For Debian/Ubuntu, use `sudo apt-get install libmysqlclient-dev`; for macOS, use `brew install mysql-client`; for Windows, install the MySQL Connector/C++ Development Headers.
Ensure all required build tools and MySQL client development headers are installed on your system (e.g., `sudo apt-get install build-essential libmysqlclient-dev` on Debian/Ubuntu, install Xcode command line tools and MySQL client on macOS, or Visual C++ build tools and MySQL Connector/C++ on Windows).
No dependency data recorded yet.