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/MariaDB:

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


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

Uploaded Source

Built Distributions

mysqlclient-2.2.5-pp310-pypy310_pp73-win_amd64.whl (207.3 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.5-pp39-pypy39_pp73-win_amd64.whl (207.3 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.5-cp313-cp313-win_amd64.whl (207.3 kB view details)

Uploaded CPython 3.13 Windows x86-64

mysqlclient-2.2.5-cp312-cp312-win_amd64.whl (207.3 kB view details)

Uploaded CPython 3.12 Windows x86-64

mysqlclient-2.2.5-cp311-cp311-win_amd64.whl (207.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

mysqlclient-2.2.5-cp310-cp310-win_amd64.whl (207.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

mysqlclient-2.2.5-cp39-cp39-win_amd64.whl (207.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

File details

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

File metadata

  • Download URL: mysqlclient-2.2.5.tar.gz
  • Upload date:
  • Size: 90.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.24

File hashes

Hashes for mysqlclient-2.2.5.tar.gz
Algorithm Hash digest
SHA256 add8643c32f738014d252d2bdebb478623b04802e8396d5903905db36474d3ff
MD5 7e312b1e95c52fa24def1da7e5ab348c
BLAKE2b-256 be951af2ee813d4f0b607082c18bb82aa05c98a95a402a1d2d5808999317cb16

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.5-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.5-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 1d2e2ca0fe8405d8d6464edd01bf059951279e4bc27284d39341bd4737b2bc64
MD5 6230f085ead673ea015184d35f336704
BLAKE2b-256 be17cd1b80247f76968c1c5a643843c69c640a8548f4f5e131be6b10d4436def

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.5-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 aee14f1872114865679fcb09aac3772de4595fa7dcf2f83a4c7afee15e508854
MD5 17e9401ed3422400cfd8ca7b2a1d36f2
BLAKE2b-256 215ac48769a4e4c500c27f8da3d1e375aca5313a1c5a94b08fc52c18b2943af5

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.5-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8012c633aab8c91ea8172ac479807135b171501b9cad1a7cd9b58c4dc8dcdab5
MD5 7bf55aec0fc457812a17f1b39c9e3f40
BLAKE2b-256 62f94a43f9fde92eb463bdb08643c4a143751be2b68cd9ad0582d7ee80836ddc

See more details on using hashes here.

File details

Details for the file mysqlclient-2.2.5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mysqlclient-2.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e871ede4261d0d42b8ed20a2459db411c7deafedd8e77b7e4ba760be4a6a752b
MD5 c649c2c8753ff08e8bdb214b26f64e65
BLAKE2b-256 8b96962f16047ed35ee8c91c10c26a98057194242f6c8da3b78238909a8014fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b54511648c1455b43ac28f8b4c1f732c5b0c343e87f7a3bd6fc9f9fe0f91934e
MD5 9d24bcbfe65500115a10287c4944ffba
BLAKE2b-256 9a120e10b29d0a880e0d2482fe93d502d537bddf647f1a35468c8b98bb517c91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b78438314199504c64f69e1e3521f2c9b419f19fcd85158b44c997b64409a6af
MD5 165fdcd356cf63e5da86bcd5eca972ed
BLAKE2b-256 87785dc4d98b998e957968aa8ad807a6ca7f751ef79ce462da11156317d7ca08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3f9625bea2b9bcde0ace76b32708762d44597491092c819fd1bff5b4e27f709b
MD5 e80532af05531aef33036e7a5fee14f4
BLAKE2b-256 dafc91fda245bb5ce2c4778103ddf80621440a570b985d2a20457c39b28a39db

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