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

Uploaded Source

Built Distributions

mysqlclient-2.2.7-pp310-pypy310_pp73-win_amd64.whl (207.8 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.7-pp39-pypy39_pp73-win_amd64.whl (208.0 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.7-cp313-cp313-win_amd64.whl (208.0 kB view details)

Uploaded CPython 3.13 Windows x86-64

mysqlclient-2.2.7-cp312-cp312-win_amd64.whl (208.0 kB view details)

Uploaded CPython 3.12 Windows x86-64

mysqlclient-2.2.7-cp311-cp311-win_amd64.whl (207.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

mysqlclient-2.2.7-cp310-cp310-win_amd64.whl (207.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

mysqlclient-2.2.7-cp39-cp39-win_amd64.whl (207.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

File details

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

File metadata

  • Download URL: mysqlclient-2.2.7.tar.gz
  • Upload date:
  • Size: 91.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.7

File hashes

Hashes for mysqlclient-2.2.7.tar.gz
Algorithm Hash digest
SHA256 24ae22b59416d5fcce7e99c9d37548350b4565baac82f95e149cac6ce4163845
MD5 95868b0f5c4c0eada33d18ca959cc512
BLAKE2b-256 6168810093cb579daae426794bbd9d88aa830fae296e85172d18cb0f0e5dd4bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 92af368ed9c9144737af569c86d3b6c74a012a6f6b792eb868384787b52bb585
MD5 5afbe258ed3fe61c794e929b5eb04fda
BLAKE2b-256 16cc5b1570be9f8597ee41e2a0bd7b62ba861ec2c81898d9449f3d6bfbe15d29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 977e35244fe6ef44124e9a1c2d1554728a7b76695598e4b92b37dc2130503069
MD5 c5e66cf980a97cc36113bc512be3aad9
BLAKE2b-256 2040b5d03494c1caa8f4da171db41d8d9d5b0d8959f893761597d97420083362

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 201a6faa301011dd07bca6b651fe5aaa546d7c9a5426835a06c3172e1056a3c5
MD5 4f9893f4390710ffb3dfcdd47c39b51f
BLAKE2b-256 2901e80141f1cd0459e4c9a5dd309dee135bbae41d6c6c121252fdd853001a8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4b4c0200890837fc64014cc938ef2273252ab544c1b12a6c1d674c23943f3f2e
MD5 7f475f773b112f4189265090faec42fc
BLAKE2b-256 bbb52a8a4bcba3440550f358b839638fe8ec9146fa3c9194890b4998a530c926

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a22d99d26baf4af68ebef430e3131bb5a9b722b79a9fcfac6d9bbf8a88800687
MD5 8fbca1424d32f1e9ad72d0bbd5c98e50
BLAKE2b-256 efe33e2de3f93cd60dd63bd229ec3e3b679f682982614bf513d046c2722aa4ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2e3c11f7625029d7276ca506f8960a7fd3c5a0a0122c9e7404e6a8fe961b3d22
MD5 80a9267d5d16848953b22d451a116778
BLAKE2b-256 0c24cdaaef42aac7d53c0a01bb638da64961c293b1b6d204efd47400a68029d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 199dab53a224357dd0cb4d78ca0e54018f9cee9bf9ec68d72db50e0a23569076
MD5 ee1fe72d91aa0ecb18a71d785e021688
BLAKE2b-256 0ee0524b0777524e0d410f71987f556dd6a0e3273fdb06cd6e91e96afade7220

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page