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.0.tar.gz (89.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded PyPy Windows x86-64

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

Uploaded PyPy Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for mysqlclient-2.2.0.tar.gz
Algorithm Hash digest
SHA256 04368445f9c487d8abb7a878e3d23e923e6072c04a6c320f9e0dc8a82efba14e
MD5 10b4b59844d9d7d1507d2d8eb09eb61a
BLAKE2b-256 de9cb176826e8994551ce826404dab97e305a4bb76c8b0a4e016fabda2901c71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 530ece9995a36cadb6211b9787f0c9e05cdab6702549bdb4236af5e9b535ed6a
MD5 cd13662de0bc14cf925609460ffc6095
BLAKE2b-256 99d19d0f137cd160cf60526e87c97cfaf9f7b969848288ef341f6bc68ba42b6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.0-pp38-pypy38_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 955dba905a7443ce4788c63fdb9f8d688316260cf60b20ff51ac3b1c77616ede
MD5 498f9bfcc37b14b947e97d7bfd165438
BLAKE2b-256 021dd9ebb84cfc2be5b0dd1c706e37c18f11f922f417df96572d450f97998a63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5670679ff1be1cc3fef0fa81bf39f0cd70605ba121141050f02743eb878ac114
MD5 7bca3fc33e06557a040bc12f7dde53fd
BLAKE2b-256 6d48571d99aa4634719c92d516c7bada1091ab85cebbd02fcf83f34b19f04c87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 68837b6bb23170acffb43ae411e47533a560b6360c06dac39aa55700972c93b2
MD5 130ae2004390ab662629f751254485ac
BLAKE2b-256 20f1af81742264efd8e37c609a30f8aa72629bf039dd286e2b7f65ece68a96bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9c6b142836c7dba4f723bf9c93cc46b6e5081d65b2af807f400dda9eb85a16d0
MD5 3592ba9df1cd816cbb2bb90353cf2458
BLAKE2b-256 79bb5f9eec6eabe12240e1bb5001630b65fa4a1e43b49139f6248b0ba4afba4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 004fe1d30d2c2ff8072f8ea513bcec235fd9b896f70dad369461d0ad7e570e98
MD5 09066e4b37c808f68a51152a46bf4a7c
BLAKE2b-256 164c240093dfe5662a384430ef159b7f10899d71cc0d183dec877e8ea20c3af7

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