Skip to main content

Python interface to MySQL

Project description

mysqlclient

Build Status

This is a fork of MySQLdb1.

This project adds Python 3 support and bug fixes. I hope this fork is merged back to MySQLdb1 like distribute was merged back to setuptools.

Install

Prerequisites

You may need to install the Python and MySQL development headers and libraries like so:

  • sudo apt-get install python-dev default-libmysqlclient-dev # Debian / Ubuntu
  • sudo yum install python-devel mysql-devel # Red Hat / CentOS
  • brew install mysql-connector-c # macOS (Homebrew) (Currently, it has bug. See below)

On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.

Note on Python 3 : if you are using python3 then you need to install python3-dev using the following command :

sudo apt-get install python3-dev # debian / Ubuntu

sudo yum install python3-devel # Red Hat / CentOS

Note about bug of MySQL Connector/C on macOS

See also: https://bugs.mysql.com/bug.php?id=86971

Versions of MySQL Connector/C may have incorrect default configuration options that cause compilation errors when mysqlclient-python is installed. (As of November 2017, this is known to be true for homebrew's mysql-connector-c and official package)

Modification of mysql_config resolves these issues as follows.

Change

# on macOS, on or about line 112:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "

to

# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"

An improper ssl configuration may also create issues; see, e.g, brew info openssl for details on macOS.

Install from PyPI

pip install mysqlclient

NOTE: Wheels for Windows may be not released with source package. You should pin version in your requirements.txt to avoid trying to install newest source package.

Install from source

  1. Download source by git clone or zipfile.
  2. Customize site.cfg
  3. python setup.py install

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

Uploaded Source

Built Distributions

mysqlclient-1.4.4-cp37-cp37m-win_amd64.whl (178.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

mysqlclient-1.4.4-cp36-cp36m-win_amd64.whl (178.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

File details

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

File metadata

  • Download URL: mysqlclient-1.4.4.tar.gz
  • Upload date:
  • Size: 86.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for mysqlclient-1.4.4.tar.gz
Algorithm Hash digest
SHA256 9c737cc55a5dc8dd3583a942d5a9b21be58d16f00f5fefca4e575e7d9682e98c
MD5 f49b3ecf6b5f504919959b2ab0119b05
BLAKE2b-256 4d38c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqlclient-1.4.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 178.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for mysqlclient-1.4.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 79a498ddda955e488f80c82a6392bf6e07c323d48db236033f33825665d8ba5c
MD5 a7994a71a8ed5e5806809d12d65b6a1c
BLAKE2b-256 64463811fe37b1e1a39d6c47f44957cdae9c207bc23bf6c22ebb1d7a6892a55f

See more details on using hashes here.

File details

Details for the file mysqlclient-1.4.4-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: mysqlclient-1.4.4-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 178.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for mysqlclient-1.4.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 8c3b61d89f7daaeab6aad6bf4c4bc3ef30bec1a8169f94dc59aea87ba2fabf80
MD5 63910d838d8cfe810c839e74702a41ff
BLAKE2b-256 c1115f5506582050a627e469b1b944894c1dfab0c7ae8084d6e78c6765edafd2

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