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.7

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.7
File Size Uploaded
mysqlclient-2.2.7.tar.gz 91.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for mysqlclient 2.2.7
File
mysqlclient-2.2.7-pp310-pypy310_pp73-win_amd64.whl PyPy 3.10 PyPy 3.10 7.3 Windows x86-64 Details
mysqlclient-2.2.7-pp39-pypy39_pp73-win_amd64.whl PyPy 3.9 PyPy 3.9 7.3 Windows x86-64 Details
mysqlclient-2.2.7-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
mysqlclient-2.2.7-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
mysqlclient-2.2.7-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
mysqlclient-2.2.7-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
mysqlclient-2.2.7-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.7.tar.gz

Download URL mysqlclient-2.2.7.tar.gz
Size 91.4 kB
Tags Source
SHA-256 checksum
How to use checksums
24ae22b59416d5fcce7e99c9d37548350b4565baac82f95e149cac6ce4163845
BLAKE2b-256 checksum
How to use checksums
6168810093cb579daae426794bbd9d88aa830fae296e85172d18cb0f0e5dd4bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-pp310-pypy310_pp73-win_amd64.whl
Size 207.8 kB
Tags PyPy 3.10 PyPy 3.10 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
92af368ed9c9144737af569c86d3b6c74a012a6f6b792eb868384787b52bb585
BLAKE2b-256 checksum
How to use checksums
16cc5b1570be9f8597ee41e2a0bd7b62ba861ec2c81898d9449f3d6bfbe15d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-pp39-pypy39_pp73-win_amd64.whl
Size 208.0 kB
Tags PyPy 3.9 PyPy 3.9 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
977e35244fe6ef44124e9a1c2d1554728a7b76695598e4b92b37dc2130503069
BLAKE2b-256 checksum
How to use checksums
2040b5d03494c1caa8f4da171db41d8d9d5b0d8959f893761597d97420083362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-cp313-cp313-win_amd64.whl
Size 208.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
201a6faa301011dd07bca6b651fe5aaa546d7c9a5426835a06c3172e1056a3c5
BLAKE2b-256 checksum
How to use checksums
2901e80141f1cd0459e4c9a5dd309dee135bbae41d6c6c121252fdd853001a8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-cp312-cp312-win_amd64.whl
Size 208.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4b4c0200890837fc64014cc938ef2273252ab544c1b12a6c1d674c23943f3f2e
BLAKE2b-256 checksum
How to use checksums
bbb52a8a4bcba3440550f358b839638fe8ec9146fa3c9194890b4998a530c926
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-cp311-cp311-win_amd64.whl
Size 207.7 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a22d99d26baf4af68ebef430e3131bb5a9b722b79a9fcfac6d9bbf8a88800687
BLAKE2b-256 checksum
How to use checksums
efe33e2de3f93cd60dd63bd229ec3e3b679f682982614bf513d046c2722aa4ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-cp310-cp310-win_amd64.whl
Size 207.7 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
2e3c11f7625029d7276ca506f8960a7fd3c5a0a0122c9e7404e6a8fe961b3d22
BLAKE2b-256 checksum
How to use checksums
0c24cdaaef42aac7d53c0a01bb638da64961c293b1b6d204efd47400a68029d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

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

Download URL mysqlclient-2.2.7-cp39-cp39-win_amd64.whl
Size 207.9 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
199dab53a224357dd0cb4d78ca0e54018f9cee9bf9ec68d72db50e0a23569076
BLAKE2b-256 checksum
How to use checksums
0ee0524b0777524e0d410f71987f556dd6a0e3273fdb06cd6e91e96afade7220
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

Release history Release notifications | RSS feed

2.3.0

17 release files

2.2.8

7 release files

This release

2.2.7 This release

8 release files

2.2.6

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