Python interface to MySQL
Project description
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:
- Python mailing list python-list
- Slack pythondev.slack.com
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file mysqlclient-2.2.6.tar.gz
.
File metadata
- Download URL: mysqlclient-2.2.6.tar.gz
- Upload date:
- Size: 91.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0b46d9b78b461dbb62482089ca8040fa916595b1b30f831ebbd1b0a82b43d53 |
|
MD5 | 1a6609e521ec597e8d9bf94a335a0cab |
|
BLAKE2b-256 | 7d6251fbcd851834c830c940ded80280f593bd031137603329dd89479c68c5be |
File details
Details for the file mysqlclient-2.2.6-pp310-pypy310_pp73-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-pp310-pypy310_pp73-win_amd64.whl
- Upload date:
- Size: 207.6 kB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3efb849d6f7ef4b9788a0eda2e896b975e0ebf1d6bf3dcabea63fd698e5b0b5 |
|
MD5 | 8c48bc9bb0a06c72e9460a717a3e66d4 |
|
BLAKE2b-256 | dbb464d6a3b1e0c7d58dfce962595add65cd0fa181db2c2ecc524cc4c8f7c168 |
File details
Details for the file mysqlclient-2.2.6-pp39-pypy39_pp73-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-pp39-pypy39_pp73-win_amd64.whl
- Upload date:
- Size: 207.8 kB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3da70a07753ba6be881f7d75e795e254f6a0c12795778034acc69769b0649d37 |
|
MD5 | 34fd8e34270c4612ae8aa8c5533d8ccc |
|
BLAKE2b-256 | b9c5cbb4f24288ffbdf416c572e2e98b5b30bcc03fd09ae1b3538b04406b895b |
File details
Details for the file mysqlclient-2.2.6-cp313-cp313-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 207.8 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794857bce4f9a1903a99786dd29ad7887f45a870b3d11585b8c51c4a753c4174 |
|
MD5 | e12a7ce38f1a77b52df2a289e478c0d4 |
|
BLAKE2b-256 | 7f929d67ec977119abf692429751b6ce5b84baef33cded260768d813e742be08 |
File details
Details for the file mysqlclient-2.2.6-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 207.8 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e940b41d85dfd7b190fa47d52f525f878cfa203d4653bf6a35b271b3c3be125b |
|
MD5 | 167426c537d4c8e5b862ebb1aad5f783 |
|
BLAKE2b-256 | f2e0d4806d4970136047ba247ad738d8d9e19655f114a91326fc790d86f4234e |
File details
Details for the file mysqlclient-2.2.6-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 207.5 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c5b30be0675080b9c815f457d73397f0442173e7be83d089b126835e2617ae |
|
MD5 | ad707b8b97c29d18a43897a131ebf7ef |
|
BLAKE2b-256 | e2f63ac198c2633dc49de56b4631353e7a8b241fbda77bddb635c0b2ae57b9e3 |
File details
Details for the file mysqlclient-2.2.6-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 207.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e94a92858203d97fd584bdb6d7ee8c56f2590db8d77fd44215c0dcf5e739bc37 |
|
MD5 | c06cdb9c36b02b97aa00b54587879ad1 |
|
BLAKE2b-256 | 1a04f4e68d1a71b53ad81ac21e37729c1fcf38be46b88e3d47ab315e36abace0 |
File details
Details for the file mysqlclient-2.2.6-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: mysqlclient-2.2.6-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 207.7 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0a5cddf1d3488b254605041070086cac743401d876a659a72d706a0d89c8ebb |
|
MD5 | b173e5476652d39abbb74ff2883afe16 |
|
BLAKE2b-256 | 995ac5f8e21d8eeec052f7cf08f400a204f630c91eb2339c385c94d114f2945e |