我在MAC OS Sierra上處理Python3的pip install mysqlclient
時遇到問題。在mac os上爲python3安裝mysqlclient for macriadb
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.12-x86_64-3.6
clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/openssl/1.0.2k/include -Dversion_info=(1,3,10,'final',0) -D__version__=1.3.10 -I/usr/local/Cellar/mariadb/10.2.6/include/mysql -I/usr/local/Cellar/mariadb/10.2.6/include/mysql/.. -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.12-x86_64-3.6/_mysql.o
_mysql.c:1911:42: error: no member named 'reconnect' in 'struct st_mysql'
if (reconnect != -1) self->connection.reconnect = reconnect;
~~~~~~~~~~~~~~~~^
1 error generated.
error: command 'clang' failed with exit status 1
我已經安裝了MariaDB和xcode-select --install
並進行了處理。
將intressting知道爲什麼或他們從mariadb刪除10.2.X –
我認爲這與更新日誌的這一行有關:舊的GPL客戶端庫不見了;現在MariaDB服務器帶有LGPL連接器/ C客戶端庫(MDEV-9055) – notFloran
問題本身就是,應用程序(如Python)不應該觸及MYSQL或MYSQL_STMT結構的內部,特別是如果有API函數可用的話。 MySQL在2004年添加了選項MYSQL_OPT_RECONNECT,以通過mysql_options()調用更改重新連接行爲 - 所以現在是時候修復它了。 –