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
$ 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
$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
$ export PATH="/usr/local/opt/mysql-client/bin:$PATH"
$ 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 mysql_config or mariadb_config 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.1.0.tar.gz (87.6 kB view details)

Uploaded Source

Built Distributions

mysqlclient-2.1.0-cp310-cp310-win_amd64.whl (180.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

mysqlclient-2.1.0-cp39-cp39-win_amd64.whl (180.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

mysqlclient-2.1.0-cp38-cp38-win_amd64.whl (180.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

mysqlclient-2.1.0-cp37-cp37m-win_amd64.whl (180.0 kB view details)

Uploaded CPython 3.7m Windows x86-64

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0.tar.gz
  • Upload date:
  • Size: 87.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mysqlclient-2.1.0.tar.gz
Algorithm Hash digest
SHA256 973235686f1b720536d417bf0a0d39b4ab3d5086b2b6ad5e6752393428c02b12
MD5 999953d039775ff905f754acd70b13e2
BLAKE2b-256 de79d02be3cb942afda6c99ca207858847572e38146eb73a7c4bfe3bdf154626

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 180.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mysqlclient-2.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 02c8826e6add9b20f4cb12dcf016485f7b1d6e30356a1204d05431867a1b3947
MD5 c9764df272b70fbf6345df4f407bc795
BLAKE2b-256 f43335f73b08e0a898192fe3a273dd5c18e1b3cadb5dab6b701987bf07dbb296

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 180.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mysqlclient-2.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e6279263d5a9feca3e0edbc2b2a52c057375bf301d47da2089c075ff76331d14
MD5 f505e9ced72f77cef5006105fd8e2cd0
BLAKE2b-256 cae36f4de4c7db07122040e641d0579466b67dd2d2e8df8db7abcda89aaa5724

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 180.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mysqlclient-2.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2c8410f54492a3d2488a6a53e2d85b7e016751a1e7d116e7aea9c763f59f5e8c
MD5 fdca6b89d72ef8090a8e60bd69c5280b
BLAKE2b-256 2c2f68e56c63b6d9c85a698b6f3d938e298572a2d63e587c2a52806ba4ffdccc

See more details on using hashes here.

File details

Details for the file mysqlclient-2.1.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: mysqlclient-2.1.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 180.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mysqlclient-2.1.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b62d23c11c516cedb887377c8807628c1c65d57593b57853186a6ee18b0c6a5b
MD5 45b219e0fd5f0ff1dfcc4945328aff3e
BLAKE2b-256 7d4318d83cf28b3ddae56f9acd5f95e9feacf96d9a5049a58afacafbe21ff3cf

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