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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

mysqlclient-2.1.0rc1-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.0rc1.tar.gz.

File metadata

  • Download URL: mysqlclient-2.1.0rc1.tar.gz
  • Upload date:
  • Size: 87.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 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.0rc1.tar.gz
Algorithm Hash digest
SHA256 eea2c3ec917f58891cb8171a4996e74002b8598b86dfb6b61a85951d11544bdd
MD5 cc6eec979ef86e72233b2c05a8ca2853
BLAKE2b-256 9c285e2c6892bb5466baf9d689643f163a8cff974dc9c9cedc857f3aeb3dde2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0rc1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 180.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 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.0rc1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1a76e3f58a5a4520579f4f7ad008c9ad9178d1d3c36030a7158ef6e8126b362c
MD5 baa016354ea1927b36a0ba77142217d2
BLAKE2b-256 57654016ee767b8a8b193492b93c723a48ab0c9116ce966e111680f0c65d6d7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0rc1-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.4.2 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.0rc1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9d93da0f7b55beec82d8d278bb9f0b2fef19915ea2764dd5df733d82dfbcdfd8
MD5 f99662b105765adc00eebee4a9e58a60
BLAKE2b-256 cda5c7f4df93d8786da56d840c32e8a8b25e3e859546febae4514d0e48c5a9d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0rc1-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.4.2 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.0rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 37286371cf4d80085e9b8bfa9a70d0e60619620442d390c4ee2715b368827bbf
MD5 cc492a165171f7f75fdd34bf7b30ecea
BLAKE2b-256 dbf1f32deb6950c288a0763f0859db5dda5c32f2e1739bbea10edca261beb8c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-2.1.0rc1-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.4.2 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.0rc1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4358a8a6ff00558b00a5dea82c3bd75f41aa6ca064662ed2b85a5ac23f5c4c6c
MD5 5d1e723865225768afc55655d8b2c942
BLAKE2b-256 f5320e5959d86cb14cfff91e10be739d228b4698b4a6a91cf23ab42479240f15

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