Skip to content

homebrew migrates mysql-connector-c to mysql-client #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You may need to install the Python and MySQL development headers and libraries l

* `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)
* `brew install mysql-client` # macOS (Homebrew)

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

Expand All @@ -25,33 +25,6 @@ On Windows, there are binary wheels you can install without MySQLConnector/C or

`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](https://dev.mysql.com/downloads/connector/c/))

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`
Expand Down