Skip to main content

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/MariaDB:

Or when you have question about MySQL/MariaDB:

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 pkg-config
$ 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 pkg-config
$ export PKG_CONFIG_PATH="$(brew --prefix)/opt/mysql-client/lib/pkgconfig"
$ 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 pkg-config # Debian / Ubuntu
  • % sudo yum install python3-devel mysql-devel pkgconfig # Red Hat / CentOS

Then you can install mysqlclient via pip now:

$ pip install mysqlclient

Customize build (POSIX)

mysqlclient uses pkg-config --cflags --ldflags mysqlclient 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.2.6

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.2.6
File Size Uploaded
mysqlclient-2.2.6.tar.gz 91.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for mysqlclient 2.2.6
File
mysqlclient-2.2.6-pp310-pypy310_pp73-win_amd64.whl PyPy 3.10 PyPy 3.10 7.3 Windows x86-64 Details
mysqlclient-2.2.6-pp39-pypy39_pp73-win_amd64.whl PyPy 3.9 PyPy 3.9 7.3 Windows x86-64 Details
mysqlclient-2.2.6-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
mysqlclient-2.2.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
mysqlclient-2.2.6-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
mysqlclient-2.2.6-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
mysqlclient-2.2.6-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details

Total release size: 1.5 MB

Release files / mysqlclient-2.2.6.tar.gz

Download URL mysqlclient-2.2.6.tar.gz
Size 91.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c0b46d9b78b461dbb62482089ca8040fa916595b1b30f831ebbd1b0a82b43d53
BLAKE2b-256 checksum
How to use checksums
7d6251fbcd851834c830c940ded80280f593bd031137603329dd89479c68c5be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-pp310-pypy310_pp73-win_amd64.whl

Download URL mysqlclient-2.2.6-pp310-pypy310_pp73-win_amd64.whl
Size 207.6 kB
Tags PyPy 3.10 PyPy 3.10 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
f3efb849d6f7ef4b9788a0eda2e896b975e0ebf1d6bf3dcabea63fd698e5b0b5
BLAKE2b-256 checksum
How to use checksums
dbb464d6a3b1e0c7d58dfce962595add65cd0fa181db2c2ecc524cc4c8f7c168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-pp39-pypy39_pp73-win_amd64.whl

Download URL mysqlclient-2.2.6-pp39-pypy39_pp73-win_amd64.whl
Size 207.8 kB
Tags PyPy 3.9 PyPy 3.9 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
3da70a07753ba6be881f7d75e795e254f6a0c12795778034acc69769b0649d37
BLAKE2b-256 checksum
How to use checksums
b9c5cbb4f24288ffbdf416c572e2e98b5b30bcc03fd09ae1b3538b04406b895b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-cp313-cp313-win_amd64.whl

Download URL mysqlclient-2.2.6-cp313-cp313-win_amd64.whl
Size 207.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
794857bce4f9a1903a99786dd29ad7887f45a870b3d11585b8c51c4a753c4174
BLAKE2b-256 checksum
How to use checksums
7f929d67ec977119abf692429751b6ce5b84baef33cded260768d813e742be08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-cp312-cp312-win_amd64.whl

Download URL mysqlclient-2.2.6-cp312-cp312-win_amd64.whl
Size 207.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
e940b41d85dfd7b190fa47d52f525f878cfa203d4653bf6a35b271b3c3be125b
BLAKE2b-256 checksum
How to use checksums
f2e0d4806d4970136047ba247ad738d8d9e19655f114a91326fc790d86f4234e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-cp311-cp311-win_amd64.whl

Download URL mysqlclient-2.2.6-cp311-cp311-win_amd64.whl
Size 207.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
43c5b30be0675080b9c815f457d73397f0442173e7be83d089b126835e2617ae
BLAKE2b-256 checksum
How to use checksums
e2f63ac198c2633dc49de56b4631353e7a8b241fbda77bddb635c0b2ae57b9e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-cp310-cp310-win_amd64.whl

Download URL mysqlclient-2.2.6-cp310-cp310-win_amd64.whl
Size 207.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
e94a92858203d97fd584bdb6d7ee8c56f2590db8d77fd44215c0dcf5e739bc37
BLAKE2b-256 checksum
How to use checksums
1a04f4e68d1a71b53ad81ac21e37729c1fcf38be46b88e3d47ab315e36abace0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release files / mysqlclient-2.2.6-cp39-cp39-win_amd64.whl

Download URL mysqlclient-2.2.6-cp39-cp39-win_amd64.whl
Size 207.7 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
b0a5cddf1d3488b254605041070086cac743401d876a659a72d706a0d89c8ebb
BLAKE2b-256 checksum
How to use checksums
995ac5f8e21d8eeec052f7cf08f400a204f630c91eb2339c385c94d114f2945e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.1

Release history Release notifications | RSS feed

2.3.0

17 release files

2.2.8

7 release files

2.2.7

8 release files

This release

2.2.6 This release

8 release files

2.2.5

8 release files

2.2.4

9 release files

2.2.3

9 release files

2.2.2

9 release files

2.2.1

9 release files

2.2.0

7 release files

2.1.1

7 release files

2.1.0

5 release files

2.0.3

5 release files

2.0.2

5 release files

2.0.1

4 release files

2.0.0

4 release files

1.4.6

4 release files

1.4.5

3 release files

1.4.4

3 release files

1.4.3

1 release file

1.4.2

1 release file

1.4.1

3 release files

1.4.0

3 release files

1.3.13

1 release file

1.3.10

5 release files

1.3.9

3 release files

1.3.8

1 release file

1.3.7

3 release files

1.3.6

5 release files

1.3.5

1 release file

1.3.4

5 release files

1.3.3

5 release files

1.3.2

1 release file

1.3.1

5 release files

1.3.0

1 release file

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