MySQL-python
Python interface to MySQL
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires MySQL client development libraries (libmysqlclient-dev on Linux) and a C compiler; Python 2.7 only (Python 3 not supported).
- 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 · maintenance · safety
GPL (copyleft) — Licensed under GPL (copyleft), which requires any derivative work or linked application to also be GPL-licensed. This creates legal constraints for proprietary software.
last release 2014-01-02 (4607 days) · last repo commit 2020-10-26 · 662 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 148,447 downloads/mo, #11,033 on PyPI
Alternatives
Verify before relying
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()- 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
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 on it.
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
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.
Requires MySQL client development libraries (libmysqlclient-dev on Linux) and a C compiler; Python 2.7 only (Python 3 not supported).
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()
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 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentLicense :: OSI Approved :: GNU General Public License (GPL)Operating System :: MacOS :: MacOS XOperating System :: Microsoft :: Windows :: Windows NT/2000Operating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: CProgramming Language :: PythonTopic :: DatabaseTopic :: Database :: Database Engines/Servers |
Evidence: MySQL-python-1.2.5.win32-py2.7.exe; MySQL-python-1.2.5.zip
Tags
Let your AI agent find packages like this
Example. Real query, live index.
An agent finds packages by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language. Give your agent the search over MCP.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also mysql-connector · mysql · mysql-connector-python · mysql-connector-python-rf · mysqlclient · PyMySQL · mariadb · pyodbc · django-db-connection-pool · aiomysql