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="$(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.2.tar.gz (90.1 kB view details)

Uploaded Source

Built Distributions

mysqlclient-2.2.2-pp310-pypy310_pp73-win_amd64.whl (203.0 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.2-pp39-pypy39_pp73-win_amd64.whl (203.0 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.2-pp38-pypy38_pp73-win_amd64.whl (203.2 kB view details)

Uploaded PyPy Windows x86-64

mysqlclient-2.2.2-cp312-cp312-win_amd64.whl (203.0 kB view details)

Uploaded CPython 3.12 Windows x86-64

mysqlclient-2.2.2-cp311-cp311-win_amd64.whl (202.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

mysqlclient-2.2.2-cp310-cp310-win_amd64.whl (202.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

mysqlclient-2.2.2-cp39-cp39-win_amd64.whl (203.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

mysqlclient-2.2.2-cp38-cp38-win_amd64.whl (203.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for mysqlclient-2.2.2.tar.gz
Algorithm Hash digest
SHA256 6f57715fb08c80ab80d34febe0aa8ef8810e52d527ad7da2da76e8ce25e2f2e9
MD5 53aaca6b290f34e47f027eeb9bf7c631
BLAKE2b-256 6c37aeefb97b20c08774ac57a27b0a0d19e9a2a9ec53c0802ee20920d98560f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 675336353b608916f1bf1d4aedf0dc1172bc544135c88bddd57f3a5ccc81bd90
MD5 4cfaa16de35bdfb272da7ee86b7995fb
BLAKE2b-256 5fc9c5707558c87f048e6af3759e27451833a15d05974dcbff02f7d160e379f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 52e37fd8fc0ae3a0f4dd6897449abc2e5438985e453ddfb894b5c3a7301602cc
MD5 6ad6215eb6c26eb347a5429381cdc70f
BLAKE2b-256 f7b145b413faddad8c8b60291a07c53313265848dbba36b9dc4da387941799ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-pp38-pypy38_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 e23e71ce4940949a65288ec7d189308129ba0c35d0a1b27fbeb89740e5ff2f43
MD5 723ed56c0f471a82cf202df0e28febc9
BLAKE2b-256 76ab60c61f242206c7c673ee3b14de918e3cbbddddbe60a4084a5eb5d2fdcd4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 20ad697e188ce175903b3ad66cddab751c28bc132ff0f7b5cefa6173b99fa608
MD5 7534a6f6786d3b2a3295705de35df5dd
BLAKE2b-256 d261b840d6c476b905e7f09c54664b12450dca655dbdd152c8f12728a43c2eb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3d4ebe14e6a00b0abf6e467c95cf1ec5902c605e4090c0c2ebbc1dee8fc0d795
MD5 34ffa47dcceb2a905a3fe45a1c2e3b78
BLAKE2b-256 f61a2cde441e5dad2999e1b81cd648cb9a6e8921d4db2b52a74abf7eba3d537a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3f2742b7791aa3c4cbdc2a972524aa63443414c0582e601bc8d948f43d7f5dd9
MD5 6922c0d25381f7dd7c0a5f831e4fd431
BLAKE2b-256 8a73e03a987d631b43fc2cd8caf00aade81e566cbeab55c7625e8f736b33e07b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 45b1785afeecc4f3b998ab7ea7bf25351c03a11dabbfe34590d70290e4f4496c
MD5 84cea344b36c83b9dd0fb36f51afb11f
BLAKE2b-256 7f197858daf8ed571b851f6380b5db179944299aa4c19df10a4529b166b4af0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysqlclient-2.2.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8b3771525532cdef672f2808a485fe71216625c41c38dd9dbbe96e3aa0e99bbb
MD5 6c6b8ec7257cb74a7c4a5984190e6a56
BLAKE2b-256 6e8d8ab7a0aeee34267573ef6e126b1d24a95ead1f777f345321b7ff413c659f

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