mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 02:54:29 +08:00
Add note about annoying MySQL Connector bug. (#212)
This commit is contained in:

committed by
INADA Naoki

parent
b948553229
commit
d65e10e356
35
README.md
35
README.md
@ -13,11 +13,11 @@ I hope this fork is merged back to MySQLdb1 like distribute was merged back to s
|
|||||||
|
|
||||||
You may need to install the Python and MySQL development headers and libraries like so:
|
You may need to install the Python and MySQL development headers and libraries like so:
|
||||||
|
|
||||||
`sudo apt-get install python-dev libmysqlclient-dev` # Debian / Ubuntu
|
* `sudo apt-get install python-dev 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)
|
||||||
|
|
||||||
`sudo yum install python-devel mysql-devel` # Red Hat / CentOS
|
On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.
|
||||||
|
|
||||||
On Windows, there are binary wheel 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 :
|
#### Note on Python 3 : if you are using python3 then you need to install python3-dev using the following command :
|
||||||
|
|
||||||
@ -25,7 +25,32 @@ On Windows, there are binary wheel you can install without MySQLConnector/C or M
|
|||||||
|
|
||||||
`sudo yum install python3-devel ` # Red Hat / CentOS
|
`sudo yum install python3-devel ` # Red Hat / CentOS
|
||||||
|
|
||||||
`brew install mysql-connector-c` # macOS (Homebrew)
|
#### **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
|
### Install from PyPI
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ except ImportError:
|
|||||||
# of mysql_config
|
# of mysql_config
|
||||||
|
|
||||||
def dequote(s):
|
def dequote(s):
|
||||||
|
if not s:
|
||||||
|
raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")
|
||||||
if s[0] in "\"'" and s[0] == s[-1]:
|
if s[0] in "\"'" and s[0] == s[-1]:
|
||||||
s = s[1:-1]
|
s = s[1:-1]
|
||||||
return s
|
return s
|
||||||
|
Reference in New Issue
Block a user