Skip to main content

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

Metadata

Release files for mysqlclient 1.4.2.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mysqlclient 1.4.2.post1
File Size Uploaded
mysqlclient-1.4.2.post1.tar.gz 85.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for mysqlclient 1.4.2.post1
File Interpreter ABI Platform
mysqlclient-1.4.2.post1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
mysqlclient-1.4.2.post1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details

Total release size: 443.1 kB

Release files / mysqlclient-1.4.2.post1.tar.gz

Download URL mysqlclient-1.4.2.post1.tar.gz
Size 85.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f257d250f2675d0ef99bd318906f3cfc05cef4a2f385ea695ff32a3f04b9f9a7
BLAKE2b-256 checksum
How to use checksums
f4f13bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

Release files / mysqlclient-1.4.2.post1-cp37-cp37m-win_amd64.whl

Download URL mysqlclient-1.4.2.post1-cp37-cp37m-win_amd64.whl
Size 178.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
62e4770b6a797b9416bcf70488365b7d6b9c9066878108499c559293bb464380
BLAKE2b-256 checksum
How to use checksums
e930b40f39fcc6c39038cad3263b3b4280133fb033e0565fe4127d507aa011fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / mysqlclient-1.4.2.post1-cp36-cp36m-win_amd64.whl

Download URL mysqlclient-1.4.2.post1-cp36-cp36m-win_amd64.whl
Size 178.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
425e733b05e359a714d6007c0fc44582be66b63e5a3df0a50949274ae16f4bc6
BLAKE2b-256 checksum
How to use checksums
c11583f1444c0bbeeff9e14b0ee2cfbc985949404e325938a1b1c20adcd462ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

2.3.0

17 release files

2.2.8

7 release files

2.2.7

8 release files

2.2.6

8 release files

2.2.5

8 release files

2.2.4

9 release files

2.2.3

9 release files

2.2.2

9 release files

2.2.1

9 release files

2.2.0

7 release files

2.1.1

7 release files

2.1.0

5 release files

2.0.3

5 release files

2.0.2

5 release files

2.0.1

4 release files

2.0.0

4 release files

1.4.6

4 release files

1.4.5

3 release files

1.4.4

3 release files

1.4.3

1 release file

This release

1.4.2.post1 This release

3 release files

1.4.2

1 release file

1.4.1

3 release files

1.4.0

3 release files

1.3.13

1 release file

1.3.10

5 release files

1.3.9

3 release files

1.3.8

1 release file

1.3.7

3 release files

1.3.6

5 release files

1.3.5

1 release file

1.3.4

5 release files

1.3.3

5 release files

1.3.2

1 release file

1.3.1

5 release files

1.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page