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:

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

Release files for mysqlclient 2.2.1

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.1
File Size Uploaded
mysqlclient-2.2.1.tar.gz 90.0 kB Details

Built distributions (wheels)

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

Total release size: 1.7 MB

Release files / mysqlclient-2.2.1.tar.gz

Download URL mysqlclient-2.2.1.tar.gz
Size 90.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2c7ad15b87293b12fd44b47c46879ec95ec647f4567e866ccd70b8337584e9b2
BLAKE2b-256 checksum
How to use checksums
37fbd9a8f763c84f1e789c027af0ffc7dbf94c9a38db961484f253f0552cbb47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

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

Download URL mysqlclient-2.2.1-pp310-pypy310_pp73-win_amd64.whl
Size 202.8 kB
Tags PyPy 3.10 PyPy 3.10 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
97eee76818774bb695e018ff4c3dafaab74b9a0b0cf32c90b02caeec3b19cd8e
BLAKE2b-256 checksum
How to use checksums
38b65c8da078534566e697278ad5c871493268b22165a7192767922301948cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

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

Download URL mysqlclient-2.2.1-pp39-pypy39_pp73-win_amd64.whl
Size 202.9 kB
Tags PyPy 3.9 PyPy 3.9 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
641a7c9de443ddef186a0e89f24b4251ad44f4ddc5e7094332bf2d286d7c9e33
BLAKE2b-256 checksum
How to use checksums
aa1772681dd8cb7f30bb93867adf0f5139d07dcb8d2b418d876bf9eaa5babb03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / mysqlclient-2.2.1-pp38-pypy38_pp73-win_amd64.whl

Download URL mysqlclient-2.2.1-pp38-pypy38_pp73-win_amd64.whl
Size 203.0 kB
Tags PyPy 3.8 PyPy 3.8 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
4fabe1f4b545ed6244ad0ff426e6b27054b7e5c5b1392be0de2e5f2f59be0392
BLAKE2b-256 checksum
How to use checksums
e759e9e589b92106fe01d5b29e0c73b46f00ebab3e2e8b8c63b3c5ab74c904f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

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

Download URL mysqlclient-2.2.1-cp312-cp312-win_amd64.whl
Size 202.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
45600f4f321096bd1ead3355bc62cfcf8d97dc78df94e4ab5db72ecb5db1bd04
BLAKE2b-256 checksum
How to use checksums
f789998d7dd34a3159a69da35593e147bc4082e8774a82c806debbef52393689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

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

Download URL mysqlclient-2.2.1-cp311-cp311-win_amd64.whl
Size 202.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
8f40c872f19639366e3df27bef2ff087be0e3ee0bd3453470bd29f46b54a90f6
BLAKE2b-256 checksum
How to use checksums
925da26d4d3a19d12df4a742e93364ae3ff6a5b75678add3c0ef769d32023a5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

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

Download URL mysqlclient-2.2.1-cp310-cp310-win_amd64.whl
Size 202.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
c5a293baebbfcfa2905545198a54e90f1cf00f211eae6637d24930abb6432cba
BLAKE2b-256 checksum
How to use checksums
530ad460306c405d07abb45771becee27e8a0ec8e2a5b8dc80f1b38bc3a708e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

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

Download URL mysqlclient-2.2.1-cp39-cp39-win_amd64.whl
Size 202.8 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
9db6305cdf2a1da350f827d2a19be7f2666eafd9eb8d4f7cbbac5df847d61b99
BLAKE2b-256 checksum
How to use checksums
e068b9ab8d1287f91252aa4f7908bcf833e1852869cf558fcece2dc5f1533dde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / mysqlclient-2.2.1-cp38-cp38-win_amd64.whl

Download URL mysqlclient-2.2.1-cp38-cp38-win_amd64.whl
Size 202.8 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
1f8889cc5f0141bb307b915e981a66793df663ace92259344661084a7dd8d12a
BLAKE2b-256 checksum
How to use checksums
408c310e592d2f288cf3518f693b108d268b074482ff9c6e922d1e738e3a359f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

2.3.0

17 release files

2.2.8

7 release files

2.2.7

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

This release

2.2.1 This release

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