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

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.0
File Size Uploaded
mysqlclient-2.1.0.tar.gz 87.6 kB Details

Built distributions (wheels)

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

Total release size: 808.7 kB

Release files / mysqlclient-2.1.0.tar.gz

Download URL mysqlclient-2.1.0.tar.gz
Size 87.6 kB
Tags Source
SHA-256 checksum
How to use checksums
973235686f1b720536d417bf0a0d39b4ab3d5086b2b6ad5e6752393428c02b12
BLAKE2b-256 checksum
How to use checksums
de79d02be3cb942afda6c99ca207858847572e38146eb73a7c4bfe3bdf154626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 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.0-cp310-cp310-win_amd64.whl

Download URL mysqlclient-2.1.0-cp310-cp310-win_amd64.whl
Size 180.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
02c8826e6add9b20f4cb12dcf016485f7b1d6e30356a1204d05431867a1b3947
BLAKE2b-256 checksum
How to use checksums
f43335f73b08e0a898192fe3a273dd5c18e1b3cadb5dab6b701987bf07dbb296
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 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.0-cp39-cp39-win_amd64.whl

Download URL mysqlclient-2.1.0-cp39-cp39-win_amd64.whl
Size 180.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e6279263d5a9feca3e0edbc2b2a52c057375bf301d47da2089c075ff76331d14
BLAKE2b-256 checksum
How to use checksums
cae36f4de4c7db07122040e641d0579466b67dd2d2e8df8db7abcda89aaa5724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 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.0-cp38-cp38-win_amd64.whl

Download URL mysqlclient-2.1.0-cp38-cp38-win_amd64.whl
Size 180.4 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
2c8410f54492a3d2488a6a53e2d85b7e016751a1e7d116e7aea9c763f59f5e8c
BLAKE2b-256 checksum
How to use checksums
2c2f68e56c63b6d9c85a698b6f3d938e298572a2d63e587c2a52806ba4ffdccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 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.0-cp37-cp37m-win_amd64.whl

Download URL mysqlclient-2.1.0-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
b62d23c11c516cedb887377c8807628c1c65d57593b57853186a6ee18b0c6a5b
BLAKE2b-256 checksum
How to use checksums
7d4318d83cf28b3ddae56f9acd5f95e9feacf96d9a5049a58afacafbe21ff3cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 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 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

2.2.1

9 release files

2.2.0

7 release files

2.1.1

7 release files

This release

2.1.0 This release

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