Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d65e10e

Browse filesBrowse files
gvoyseymethane
authored andcommitted
Add note about annoying MySQL Connector bug. (PyMySQL#212)
1 parent b948553 commit d65e10e
Copy full SHA for d65e10e

File tree

Expand file treeCollapse file tree

2 files changed

+32
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+32
-5
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+30-5Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,44 @@ I hope this fork is merged back to MySQLdb1 like distribute was merged back to s
1313

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

16-
`sudo apt-get install python-dev libmysqlclient-dev` # Debian / Ubuntu
16+
* `sudo apt-get install python-dev libmysqlclient-dev` # Debian / Ubuntu
17+
* `sudo yum install python-devel mysql-devel` # Red Hat / CentOS
18+
* `brew install mysql-connector-c` # macOS (Homebrew) (Currently, it has bug. See below)
1719

18-
`sudo yum install python-devel mysql-devel` # Red Hat / CentOS
19-
20-
On Windows, there are binary wheel you can install without MySQLConnector/C or MSVC.
20+
On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.
2121

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

2424
`sudo apt-get install python3-dev` # debian / Ubuntu
2525

2626
`sudo yum install python3-devel ` # Red Hat / CentOS
2727

28-
`brew install mysql-connector-c` # macOS (Homebrew)
28+
#### **Note about bug of MySQL Connector/C on macOS**
29+
30+
See also: https://bugs.mysql.com/bug.php?id=86971
31+
32+
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/))
33+
34+
Modification of `mysql_config` resolves these issues as follows.
35+
36+
Change
37+
38+
```
39+
# on macOS, on or about line 112:
40+
# Create options
41+
libs="-L$pkglibdir"
42+
libs="$libs -l "
43+
```
44+
45+
to
46+
47+
```
48+
# Create options
49+
libs="-L$pkglibdir"
50+
libs="$libs -lmysqlclient -lssl -lcrypto"
51+
```
52+
53+
An improper ssl configuration may also create issues; see, e.g, `brew info openssl` for details on macOS.
2954

3055
### Install from PyPI
3156

‎setup_posix.py

Copy file name to clipboardExpand all lines: setup_posix.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# of mysql_config
1010

1111
def dequote(s):
12+
if not s:
13+
raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")
1214
if s[0] in "\"'" and s[0] == s[-1]:
1315
s = s[1:-1]
1416
return s

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.