Skip to main content

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:

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="/opt/homebrew/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 # 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 pkg-config --clfags --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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysqlclient-2.2.0rc1.tar.gz (89.2 kB view details)

Uploaded Source

Built Distributions

mysqlclient-2.2.0rc1-pp39-pypy39_pp73-win_amd64.whl (199.9 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.0rc1-pp38-pypy38_pp73-win_amd64.whl (200.1 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.0rc1-cp311-cp311-win_amd64.whl (199.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

mysqlclient-2.2.0rc1-cp310-cp310-win_amd64.whl (199.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

mysqlclient-2.2.0rc1-cp39-cp39-win_amd64.whl (199.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

mysqlclient-2.2.0rc1-cp38-cp38-win_amd64.whl (199.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

Details for the file mysqlclient-2.2.0rc1.tar.gz.

File metadata

  • Download URL: mysqlclient-2.2.0rc1.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for mysqlclient-2.2.0rc1.tar.gz
Algorithm Hash digest
SHA256 479372f6fa1a9a9455f1e0551c8c4f697ccc3bf167815430c2d26b63e3ff65d2
MD5 06ee694b21d8efdb7586a6d990125b2e
BLAKE2b-256 3ede305a3cd857f34a23ffe3e94f027ccdfcbb803b800b6c1c16155995a66d8d

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.0rc1-pp39-pypy39_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.0rc1-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 ce08695a45be4615959b6092b5b59c1237ff3e27b18d4bd5cbd263bb3c6ef002
MD5 419be6ab203160f73a5146f0b1cfb7d1
BLAKE2b-256 4cb9f9c152a50b46d562c5b284851d3395b467e3e8a49700fe270d5de70d13f9

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.0rc1-pp38-pypy38_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.0rc1-pp38-pypy38_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 836a3f2806b5650fab24d096f204182ecdb774851dc0bbc69ecd8b6ad589e0f2
MD5 eaae1b8cc43fa681158e2ebd960cd7f8
BLAKE2b-256 2a6d024a75ddaa81c204721b57f21bf300652f562d2694536dfd9184d31fb961

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.0rc1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.0rc1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9595a8c0f8d2255d796b56ffa874989a9000970b8e534ed8c9c6ed3faa4efcd1
MD5 f8dd378a1e0005869a81db4954ebd5d0
BLAKE2b-256 3c728bb985c07df39c9df1ff9ba60f9e6a427e0b9d9ab962f7545aee6d688a98

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.0rc1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.0rc1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c52b43b28918dc09ae57b09007df67e4b7affb7346e15e4d8b56c42e522070a4
MD5 8444eae009d430927d4771863aa8f9a0
BLAKE2b-256 c794912965f764dba847acbbce6dd52811686d94246419f0d318c0b834f0f9e2

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.0rc1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.0rc1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 361585cc789567d3b1bf4be4ba9160736f5a7539b2bc3b13ff66493ed927fdf9
MD5 a2d641d35ee68ee95e5a91e6eddd3590
BLAKE2b-256 4ebdafa57f179a0f81081698c80030a6643f8f82d15a4590e0a559688c4e6147

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.0rc1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.0rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e3b07706a44a2037e3739a3b8dddaa423d8a341dab077fa387e9c58bf6edce00
MD5 6d1f9d7e0823764ce1f8bd10293d5ba7
BLAKE2b-256 83ecc0177a57a2301f04e8b200f75e10efd8375c10a45bd0c36825cdc00e9ed2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page