# PyMySQL/mysqlclient

MySQL/MariaDB connector for Python

Repository: https://github.com/PyMySQL/mysqlclient
Canonical: https://ross.abutalabs.com/products/mysqlclient
Homepage: https://mysqlclient.readthedocs.io/
Language: Python
License: GPL-2.0
License Family: copyleft
Topics: python, mysql, mariadb
Last push: 2026-08-22T07:21:54+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 57, longevity 100
- inputs: {"age_days": 4510, "days_push": 11, "days_rel": 204, "gap_med": 56, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2536, forks 443 (observed 2026-08-28T04:06:59.156396+00:00)

## What it is
mysqlclient is a Python DB-API 2.0 compatible driver for MySQL and MariaDB, forked from MySQLdb1 with Python 3 support and bug fixes. It wraps the MySQL C API in a C extension for fast database access.

## Use cases
- connect to MySQL from Python
- query a MariaDB database in a Django app
- fast MySQL driver with C extension performance
- run SQL inserts and selects against MySQL
- replace MySQLdb with a maintained Python 3 fork
- use MySQL with SQLAlchemy in production

## When to choose
- you need maximum MySQL performance via a C extension
- you use Django or SQLAlchemy with MySQL/MariaDB
- you want the classic MySQLdb API maintained for Python 3

## When to avoid
- you want a pure-Python driver with no compilation (use PyMySQL)
- you need async database access
- you cannot install MySQL/MariaDB client development headers on your system

## Facets
- artifact type: library
- maturity: active
- function: database-driver, database
- domain: databases, backend, web-development
- platform: python, windows, cross-platform
- tags: mysql, mariadb, db-api, c-extension, sql, linux, macos

## Member repositories
- PyMySQL/mysqlclient (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:59.156396+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:25:13.218081+00:00, confidence not recorded.
  - readme: https://github.com/PyMySQL/mysqlclient (fetched 2026-08-28T04:06:59.156396+00:00, sha 60298428c4b9)
  - homepage: https://mysqlclient.readthedocs.io/ (fetched 2026-08-29T10:07:20.306346+00:00, sha 15ccc7806d50)
  - registry_pypi: https://pypi.org/pypi/mysqlclient/json (fetched 2026-08-29T10:07:20.309775+00:00, sha 64a102bf590b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
