$npx skillfedfor your agent

mysqlclient

Python interface to MySQL

With conditionsPyPI DatabaseReleased Feb 202621.6M downloads / moGPL-2.0-or-laterPlatform wheel

Decision gist · record as of 2026-08-14

platform wheels — mysqlclient-2.2.8-cp310-cp310-win_amd64.whl · mysqlclient-2.2.8-cp311-cp311-win_amd64.whl · mysqlclient-2.2.8-cp312-cp312-win_amd64.whl
v2.2.8 · released 2026-02-10 · Python >=3.10

Yes, if you need native MySQL/MariaDB connectivity and accept the GPL-2.0-or-later license terms. The package is production-stable, actively maintained, and widely used. Install friction is moderate but manageable: Windows users have pre-built wheels; Linux/macOS users must pre-install system libraries. Not suitable if your project cannot comply with GPLv2 copyleft obligations.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires MySQL or MariaDB client libraries installed on the system; on Linux/macOS, development headers must be present before pip install.
  • Windows users need Python 3.10–3.14 for pre-built wheels, or the MariaDB C Connector for source builds.
  • Medium install friction: requires MySQL or MariaDB development headers and libraries on Linux/macOS; Windows users benefit from pre-built wheels for Python 3.10–3.14.

License · maintenance · safety

GPL-2.0-or-later (copyleft) — Licensed under GPL-2.0-or-later (copyleft): any application linking mysqlclient must comply with GPLv2 terms, including potential source code disclosure obligations. Verify compatibility with your project's license before use.

last release 2026-02-10 (185 days) · last repo commit 2026-07-26 · 2,532 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 21,563,983 downloads/mo, #998 on PyPI

Verify before relying

pip install mysqlclient

import mysqlclient
conn = mysqlclient.connect(host='localhost', user='user', passwd='password', db='database')
cursor = conn.cursor()
cursor.execute('SELECT * FROM table')
results = cursor.fetchall()
conn.close()
  • Whether free threading support (experimental in v2.2.8) is production-ready for your workload.
  • Performance characteristics compared to alternative MySQL drivers in your specific use case.
  • Full scope of GPLv2 compliance requirements for your application's distribution model.
Same gist for agents: .md · .json

What it is and what it does

mysqlclient is a Python database driver for MySQL and MariaDB, forked from MySQLdb1 and extended with Python 3 support and bug fixes. It provides a low-level interface to execute SQL queries, fetch results, and manage database connections directly from Python. The package is a C extension that wraps the MySQL client library, making it a native choice for applications that need direct MySQL access.

The package requires system-level MySQL or MariaDB development libraries to build and install. On Windows, pre-built wheels are available for Python 3.10 through 3.14, simplifying installation. On Linux and macOS, you must install development headers before pip install. The project is actively maintained, supports Python 3.10 and later, and includes experimental free-threading support as of v2.2.8, though single Connection objects remain unsafe for concurrent multi-threaded access.

Use it for

  • Building web applications that require direct MySQL database connectivity and query execution independent of higher-level ORMs.
  • Writing data migration or ETL scripts that need to read from and write to MySQL/MariaDB databases with fine-grained control.
  • Creating command-line tools or batch jobs that execute complex SQL queries and process result sets from MySQL.
  • Integrating legacy MySQL databases into modern Python applications where a lightweight, native driver is preferred.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need native MySQL/MariaDB connectivity and accept the GPL-2.0-or-later license terms.

The package is production-stable, actively maintained, and widely used. Install friction is moderate but manageable: Windows users have pre-built wheels; Linux/macOS users must pre-install system libraries. Not suitable if your project cannot comply with GPLv2 copyleft obligations.

Install

mysqlclient on PyPI

Before you install

Medium install friction: requires MySQL or MariaDB development headers and libraries on Linux/macOS; Windows users benefit from pre-built wheels for Python 3.10–3.14. The project is actively maintained with a recent release and clear documentation on platform-specific setup.

Requires MySQL or MariaDB client libraries installed on the system; on Linux/macOS, development headers must be present before pip install. Windows users need Python 3.10–3.14 for pre-built wheels, or the MariaDB C Connector for source builds.

License in practice

Licensed under GPL-2.0-or-later (copyleft): any application linking mysqlclient must comply with GPLv2 terms, including potential source code disclosure obligations. Verify compatibility with your project's license before use.

Quickstart

pip install mysqlclient

import mysqlclient
conn = mysqlclient.connect(host='localhost', user='user', passwd='password', db='database')
cursor = conn.cursor()
cursor.execute('SELECT * FROM table')
results = cursor.fetchall()
conn.close()

Verify before relying

  • Whether free threading support (experimental in v2.2.8) is production-ready for your workload.
  • Performance characteristics compared to alternative MySQL drivers in your specific use case.
  • Full scope of GPLv2 compliance requirements for your application's distribution model.

Package facts

LicenseGPL-2.0-or-later copyleft
Python supportSupports the current Python release >=3.10
Install frictionMedium. Platform-specific wheel
Runtime dependenciesNone
MaintenanceActively maintained 185 days since the last release
Last repo commit
First released
Downloads21,563,983 / month, #998 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: Windows :: Windows NT/2000Operating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DatabaseTopic :: Database :: Database Engines/Servers

Evidence: mysqlclient-2.2.8-cp310-cp310-win_amd64.whl; mysqlclient-2.2.8-cp311-cp311-win_amd64.whl; mysqlclient-2.2.8-cp312-cp312-win_amd64.whl; mysqlclient-2.2.8-cp313-cp313-win_amd64.whl; mysqlclient-2.2.8-cp314-cp314t-win_amd64.whl; mysqlclient-2.2.8-cp314-cp314-win_amd64.whl

Tags

Capabilities
mysql python drivermysql database connectorpython mysql interfacemariadb python clientmysql query executiondatabase connection python
Topics
mysql-driverdatabase-connectorc-extension
PyPI keywords
MySQL

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “python mysql interface”

  • mysqlclientmysqlclient provides a Python interface to MySQL and MariaDB…
  • MySQL-pythonMySQL-python provides a Python 2 interface to MySQL databases,…
  • mysql-connectorMySQL driver written in Python that enables database connections and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

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.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

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.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

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.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

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.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

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.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also mariadb · mysql · PyMySQL · MySQL-python · django-mysql · types-mysqlclient · asyncmy · mysql-connector-python · mycli · mysql-connector