MySQL-python
Python interface to MySQL
What it is and what it does
MySQL-python is a database adapter that lets Python 2 applications connect to and query MySQL databases. It implements the Python Database API version 2.0 standard, meaning code written against it follows a common interface shared with other database drivers. The package is a thin wrapper around the MySQL C client library, providing thread-safe access to MySQL 3.23 through 5.5.
This package is effectively obsolete. It was last released in 2014 and does not support Python 3. The repository shows minimal activity since 2020. For any new project, modern alternatives are the correct choice.
Use it for:
- Maintaining legacy Python 2 applications that already depend on MySQL-python and cannot be migrated
- Running existing codebases frozen at Python 2.7 that interact with MySQL databases
- Educational purposes to understand how Python database adapters implement the Database API standard
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
MySQL-python provides a Python 2 interface to MySQL databases, implementing the Python Database API specification for executing queries and managing connections.
No. Do not install for new projects—Python 2 reached end-of-life years ago, and MySQL-python has been abandoned since 2014. If you must maintain legacy Python 2 code already using MySQL-python, keep the existing version pinned. For any new work, use a maintained alternative.
Install
mysql-python on PyPI
pip
pip install mysql-pythonuv
uv add mysql-pythonpoetry
poetry add mysql-pythonInstalling MySQL-python
Before you install
Installation requires compilation against MySQL client libraries, creating high friction on most systems. The package is abandoned—last release was 2014-01-02 and last commit 2020-10-26—making it unsuitable for new projects.
License in practice
Licensed under GPL (copyleft), which requires any derivative work or linked application to also be GPL-licensed. This creates legal constraints for proprietary software.
Quickstart
pip install MySQL-python==1.2.5
# Then in Python code:
conn = connect(host='localhost', user='user', passwd='password', db='database')
cursor = conn.cursor()
cursor.execute('SELECT * FROM table')
results = cursor.fetchall()
Requires MySQL client development libraries (libmysqlclient-dev on Linux) and a C compiler; Python 2.7 only (Python 3 not supported).
Verify before relying
- Whether MySQL client development headers are available on the target system
- Current compatibility with modern MySQL server versions beyond 5.5
- Whether the package works reliably on current Python 2.7 patch releases
- Availability of maintained forks or alternative packages for Python 3 migration
Package facts
| License | GPL (copyleft) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,607 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,447/month — #11,033 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: MySQL-python-1.2.5.win32-py2.7.exe; MySQL-python-1.2.5.zip
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
mysql-connectorMySQL driver written in Python that enables…
copyleft · top 5,000 on PyPI
mysqlThis package is a deprecated virtual wrapper…
permissive · top 15,000 on PyPI
mysql-connector-pythonMySQL Connector/Python is a PEP 249-compliant…
copyleft · top 1,000 on PyPI
mysql-connector-python-rfA pure-Python MySQL driver that implements the…
copyleft · top 15,000 on PyPI
mysqlclientmysqlclient provides a Python interface to…
copyleft · top 1,000 on PyPI
PyMySQLPyMySQL is a pure-Python MySQL and MariaDB…
permissive · top 1,000 on PyPI
mariadbMariaDB Connector/Python provides a DB API…
copyleft · top 15,000 on PyPI
pyodbcpyodbc provides Python access to ODBC databases…
permissive · top 1,000 on PyPI
django-db-connection-poolProvides connection pooling for Django database…
permissive · top 15,000 on PyPI
aiomysqlaiomysql provides async/await access to MySQL…
permissive · top 5,000 on PyPI