Skip to main content

mysqlclient-static

English | 简体中文

Self-contained mysqlclient wheels for Linux AMD64 and macOS ARM64. Install a wheel and use MySQLdb without compiling code or installing MySQL/MariaDB client libraries or authentication plugins.

This project packages mysqlclient. Django uses its standard django.db.backends.mysql backend.

Installation

uv add mysqlclient-static

With pip:

python -m pip install --only-binary=:all: mysqlclient-static

For offline installation, download the wheel matching your Python version and platform from GitHub Releases. For example, with CPython 3.12 on macOS ARM64:

python -m pip install --no-index \
  ./mysqlclient_static-2.3.0.post3-cp312-cp312-macosx_11_0_arm64.whl

Replacing mysqlclient

Both distributions provide MySQLdb. Keep one in your application dependencies:

python -m pip uninstall -y mysqlclient
python -m pip install --only-binary=:all: mysqlclient-static

A dependency declared as mysqlclient still needs to be handled in your application's dependency configuration; installing mysqlclient-static does not satisfy that distribution name.

Supported versions

Python Upstream mysqlclient Distribution version Platforms
CPython 3.9 2.2.7 2.2.7.post3 Linux AMD64, macOS ARM64
CPython 3.10–3.14 2.3.0 2.3.0.post3 Linux AMD64, macOS ARM64
CPython 3.14t (free-threaded) 2.3.0 2.3.0.post3 Linux AMD64, macOS ARM64

Linux wheels use the manylinux_2_28_x86_64 baseline. macOS wheels target macosx_11_0_arm64 (macOS 11 or later). Python 3.14t uses a separate cp314-cp314t wheel. Each concurrent thread needs its own connection.

The wheels contain MariaDB Connector/C 3.4.11, OpenSSL 3.5.9, zlib 1.3.2 and zstd 1.5.7. Linux uses the system glibc; macOS uses its system libraries.

Version numbers and wheel names

The distribution version is the upstream mysqlclient version followed by this project's packaging revision: 2.3.0.post3 means mysqlclient 2.3.0, packaging revision 3. Updates to the bundled libraries or packaging increase .postN; an upstream update starts a new version line, such as 2.3.1.post1.

Python and platform compatibility are recorded in the wheel filename:

mysqlclient_static-2.3.0.post3-cp312-cp312-macosx_11_0_arm64.whl
Part Meaning
2.3.0.post3 Upstream version and packaging revision
First cp312 CPython 3.12
Second cp312 CPython 3.12 application binary interface (ABI)
macosx_11_0_arm64 macOS 11 or later, ARM64

Each GitHub Release groups all wheels for one distribution version under a tag such as v2.3.0.post3. That version has 12 wheels: six Python variants across two platforms. v2.2.7.post3 has two wheels for Python 3.9. PyPI and GitHub Releases distribute the same files.

MySQL Server versions such as 8.0.46 and 8.4.13 describe database compatibility; they are separate from the Python driver's version.

Typical usage

Set DB_USER, DB_PASSWORD and DB_NAME in your environment:

import os
import MySQLdb
from MySQLdb.cursors import DictCursor

with MySQLdb.connect(
    host="127.0.0.1",
    user=os.environ["DB_USER"],
    password=os.environ["DB_PASSWORD"],
    database=os.environ["DB_NAME"],
    charset="utf8mb4",
) as connection:
    with connection.cursor(DictCursor) as cursor:
        cursor.execute("SELECT %s AS message", ("你好,MySQL",))
        print(cursor.fetchone())

Use %s placeholders and pass values separately. Commit writes explicitly with commit() and call rollback() on failure. A connection's with block closes the connection; it does not commit the transaction automatically.

SQLAlchemy

SQLAlchemy uses this package through its standard mysqldb dialect. Install both packages:

uv add mysqlclient-static sqlalchemy

Use mysql+mysqldb in the connection URL. Set DB_USER, DB_PASSWORD and DB_NAME as in the example above; DB_PORT defaults to 3306:

import os
from sqlalchemy import URL, create_engine, text

url = URL.create(
    "mysql+mysqldb",
    username=os.environ["DB_USER"],
    password=os.environ["DB_PASSWORD"],
    host="127.0.0.1",
    port=int(os.environ.get("DB_PORT", "3306")),
    database=os.environ["DB_NAME"],
    query={"charset": "utf8mb4"},
)
engine = create_engine(url)

with engine.connect() as connection:
    message = connection.execute(
        text("SELECT :message AS message"), {"message": "你好,MySQL"}
    ).scalar_one()
    print(message)

engine.dispose()

The same engine works with SQLAlchemy ORM Session. Use engine.begin() for a block that commits writes on success and rolls back on an exception.

Coding agents and examples

Every wheel includes these files:

Installed path Contents
MySQLdb/README.md English installation guide and typical usage
MySQLdb/README_CN.md The same guide in Simplified Chinese
MySQLdb/AGENTS.md API, transactions, connection lifecycle and integration
MySQLdb/api-symbols.json Signatures, docstrings and symbols from the upstream source
MySQLdb/examples/ Connection, transaction, Django settings and Celery task examples
from importlib.resources import files

print(files("MySQLdb").joinpath("README.md").read_text())
print(files("MySQLdb").joinpath("api-symbols.json"))

The agent guide and examples/ are maintained with the package. Each upstream version gets its own symbol index.

Compatibility baselines, bundled-library choices, and instructions for building, testing and publishing are in docs/development.md.

License and source

This project's independent original code, build scripts, configuration, documentation and examples use the MIT license. The package's PyPI license metadata is MIT. Upstream sources and derived content retain their original licenses, with component copyright and license notices retained. Each Release includes corresponding-source-*.tar.gz with the original sources, build scripts, configuration and source records.

See the component list.

Metadata

Release files for mysqlclient-static 2.3.0.post3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for mysqlclient-static 2.3.0.post3
File
mysqlclient_static-2.3.0.post3-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
mysqlclient_static-2.3.0.post3-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details
mysqlclient_static-2.3.0.post3-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
mysqlclient_static-2.3.0.post3-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
mysqlclient_static-2.3.0.post3-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
mysqlclient_static-2.3.0.post3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
mysqlclient_static-2.3.0.post3-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
mysqlclient_static-2.3.0.post3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
mysqlclient_static-2.3.0.post3-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
mysqlclient_static-2.3.0.post3-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
mysqlclient_static-2.3.0.post3-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
mysqlclient_static-2.3.0.post3-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 36.6 MB

Release files / mysqlclient_static-2.3.0.post3-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL mysqlclient_static-2.3.0.post3-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e13fd45f447d4f4963cdf518b1656204c0ba003269d979924833b3191344f355
BLAKE2b-256 checksum
How to use checksums
56f0dd01abf42cd7dceaa86479888b88d4bc78488b896d3af7bc9dea263cce2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp314-cp314t-macosx_11_0_arm64.whl

Download URL mysqlclient_static-2.3.0.post3-cp314-cp314t-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ef3ac0d14fa23ccae3c110f8ce7ca80ae0f406ea10e01067338da8da9d9d2918
BLAKE2b-256 checksum
How to use checksums
0c3145200e80e6a9149d274326b19ac7d50af8b04183572b185bed09e0394837
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL mysqlclient_static-2.3.0.post3-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.14 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
36a47d5ddabbce5bf829ee52ed959fa1f769316786e9702db3ed10f1577d2418
BLAKE2b-256 checksum
How to use checksums
2d70d08d815f0513966fecde94cf38dc0517a00d321747e8e016f6f985c05610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp314-cp314-macosx_11_0_arm64.whl

Download URL mysqlclient_static-2.3.0.post3-cp314-cp314-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
730d154118d74917302cf39f9c93cdefa442eebb7e8ae6b049bd812d737e91d2
BLAKE2b-256 checksum
How to use checksums
7a7c5486ebd04a413cbdf18c656c00a027dc09f8ed4962652a76f6a7cc53e396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL mysqlclient_static-2.3.0.post3-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.13 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6ce501a37c40eedc7af657345a8b9a1c85290d3f55bfd95d0885264b55de3618
BLAKE2b-256 checksum
How to use checksums
d85a7857ad01c540038224daeda1cbad38563899aaae27b36d6c765473494ad7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp313-cp313-macosx_11_0_arm64.whl

Download URL mysqlclient_static-2.3.0.post3-cp313-cp313-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5d9dd3d887236c99ff8f5bed4d745b943bf76e02d7a032906291b818a41f3048
BLAKE2b-256 checksum
How to use checksums
d05fdf42cd77d466c9e4cf84509bd54a91e18f94acf5ad887a81429a3b96f359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL mysqlclient_static-2.3.0.post3-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.12 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7ed4491f417f9145e375da0c856afadf78d26897b931ce8314bf87c7d0014f59
BLAKE2b-256 checksum
How to use checksums
225d4960d29fb556bccc244113cd6f81acd8bcf6261232475f8f801994d5b275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp312-cp312-macosx_11_0_arm64.whl

Download URL mysqlclient_static-2.3.0.post3-cp312-cp312-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d4ab9b51714e1956b60602a032178c6a4f692904ea8f52107ce7ce1337c4a9db
BLAKE2b-256 checksum
How to use checksums
61078ba3a458f05a412a5c7a244db66d50456dab4f129afad288ab9243f3bea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL mysqlclient_static-2.3.0.post3-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.11 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d987aa590639bd34286b06917f22250f986f31ac30c8d72d8841c2119d7a581d
BLAKE2b-256 checksum
How to use checksums
b4de438ed48e6ea0b1defb03a4ad0f11cf5dd523c5c253ea45be4e2c8597512f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp311-cp311-macosx_11_0_arm64.whl

Download URL mysqlclient_static-2.3.0.post3-cp311-cp311-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
40c6dc41349b71170b9ff4275ea73dba18c9a1dc109257d81f0b08261eb7ff00
BLAKE2b-256 checksum
How to use checksums
699bfc3e4d80f102ebeef2a9d7b0c045f3c8b56b2e61dcacf8a0d89fc51c2268
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL mysqlclient_static-2.3.0.post3-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.10 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dfade37f5faae1e1805aaaa75278f4b51828ecc92daf7a9511902d803495666f
BLAKE2b-256 checksum
How to use checksums
d149eb2e57fc9812622aefef57a54afe8e6a743b55e698580d0792b763880d7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mysqlclient_static-2.3.0.post3-cp310-cp310-macosx_11_0_arm64.whl

Download URL mysqlclient_static-2.3.0.post3-cp310-cp310-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6251a005ef18b8c1ba8bada3d60b9a1b4764423e0c46168394966b82752d90bc
BLAKE2b-256 checksum
How to use checksums
9c2fcd58cfe2b997fbf5149a8ede37ee3b1316609891cc0ac76c2416615ea7e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mysqlclient-static 2.3.0.post3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page