Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

mysqlclient

This project is a fork of MySQLdb1. This project adds Python 3 support and fixed many bugs.

Support

Do Not use Github Issue Tracker to ask help. OSS Maintainer is not free tech support

When your question looks relating to Python rather than MySQL:

Or when you have question about MySQL:

Install

Windows

Building mysqlclient on Windows is very hard. But there are some binary wheels you can install easily.

If binary wheels do not exist for your version of Python, it may be possible to build from source, but if this does not work, do not come asking for support. To build from source, download the MariaDB C Connector and install it. It must be installed in the default location (usually "C:\Program Files\MariaDB\MariaDB Connector C" or "C:\Program Files (x86)\MariaDB\MariaDB Connector C" for 32-bit). If you build the connector yourself or install it in a different location, set the environment variable MYSQLCLIENT_CONNECTOR before installing. Once you have the connector installed and an appropriate version of Visual Studio for your version of Python:

$ pip install mysqlclient

macOS (Homebrew)

Install MySQL and mysqlclient:

# Assume you are activating Python 3 venv
$ brew install mysql
$ pip install mysqlclient

If you don't want to install MySQL server, you can use mysql-client instead:

# Assume you are activating Python 3 venv
$ brew install mysql-client
$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
$ export PATH="/usr/local/opt/mysql-client/bin:$PATH"
$ pip install mysqlclient

Linux

Note that this is a basic step. I can not support complete step for build for all environment. If you can see some error, you should fix it by yourself, or ask for support in some user forum. Don't file a issue on the issue tracker.

You may need to install the Python 3 and MySQL development headers and libraries like so:

  • $ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential # Debian / Ubuntu
  • % sudo yum install python3-devel mysql-devel # Red Hat / CentOS

Then you can install mysqlclient via pip now:

$ pip install mysqlclient

Customize build (POSIX)

mysqlclient uses mysql_config or mariadb_config by default for finding compiler/linker flags.

You can use MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS environment variables to customize compiler/linker options.

$ export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags`
$ export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs`
$ pip install mysqlclient

Documentation

Documentation is hosted on Read The Docs

Metadata

Release files for mysqlclient 2.1.0rc1

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

Source distribution (sdist)

Source distribution for mysqlclient 2.1.0rc1
File Size Uploaded Provenance Actions
mysqlclient-2.1.0rc1.tar.gz 87.6 kB Without provenance Details for mysqlclient-2.1.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mysqlclient 2.1.0rc1
File Actions
mysqlclient-2.1.0rc1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for mysqlclient-2.1.0rc1-cp310-cp310-win_amd64.whl
mysqlclient-2.1.0rc1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for mysqlclient-2.1.0rc1-cp39-cp39-win_amd64.whl
mysqlclient-2.1.0rc1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for mysqlclient-2.1.0rc1-cp38-cp38-win_amd64.whl
mysqlclient-2.1.0rc1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for mysqlclient-2.1.0rc1-cp37-cp37m-win_amd64.whl

Total release size: 808.9 kB

Release files / mysqlclient-2.1.0rc1.tar.gz

Download URL mysqlclient-2.1.0rc1.tar.gz
Size 87.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eea2c3ec917f58891cb8171a4996e74002b8598b86dfb6b61a85951d11544bdd
BLAKE2b-256 checksum
How to use checksums
9c285e2c6892bb5466baf9d689643f163a8cff974dc9c9cedc857f3aeb3dde2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / mysqlclient-2.1.0rc1-cp310-cp310-win_amd64.whl

Download URL mysqlclient-2.1.0rc1-cp310-cp310-win_amd64.whl
Size 180.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1a76e3f58a5a4520579f4f7ad008c9ad9178d1d3c36030a7158ef6e8126b362c
BLAKE2b-256 checksum
How to use checksums
57654016ee767b8a8b193492b93c723a48ab0c9116ce966e111680f0c65d6d7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / mysqlclient-2.1.0rc1-cp39-cp39-win_amd64.whl

Download URL mysqlclient-2.1.0rc1-cp39-cp39-win_amd64.whl
Size 180.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
9d93da0f7b55beec82d8d278bb9f0b2fef19915ea2764dd5df733d82dfbcdfd8
BLAKE2b-256 checksum
How to use checksums
cda5c7f4df93d8786da56d840c32e8a8b25e3e859546febae4514d0e48c5a9d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / mysqlclient-2.1.0rc1-cp38-cp38-win_amd64.whl

Download URL mysqlclient-2.1.0rc1-cp38-cp38-win_amd64.whl
Size 180.4 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
37286371cf4d80085e9b8bfa9a70d0e60619620442d390c4ee2715b368827bbf
BLAKE2b-256 checksum
How to use checksums
dbf1f32deb6950c288a0763f0859db5dda5c32f2e1739bbea10edca261beb8c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / mysqlclient-2.1.0rc1-cp37-cp37m-win_amd64.whl

Download URL mysqlclient-2.1.0rc1-cp37-cp37m-win_amd64.whl
Size 180.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
4358a8a6ff00558b00a5dea82c3bd75f41aa6ca064662ed2b85a5ac23f5c4c6c
BLAKE2b-256 checksum
How to use checksums
f5320e5959d86cb14cfff91e10be739d228b4698b4a6a91cf23ab42479240f15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Security for mysqlclient 2.1.0rc1

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.

Release history Release notifications | RSS feed

This release
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