环境准备-MAC安装mysql-client

1、官网下载 mysql-connector并安装

mysql-connector-python-8.0.19-macos10.15.dmg  安装

2、pip install mysqlclient

3、修改mysql_config文件

修改前先备份

···

cp /usr/local/bin/mysql_config /usr/local/bin/mysql_config.backup


···

修改配置文件

vim /usr/local/bin/mysql_config

# Create options

libs="-L$pkglibdir"

libs="$libs -l "

替换成以下内容

```

# Create options

libs="-L$pkglibdir"

libs="$libs -lmysqlclient -lssl -lcrypto"

```

4、执行PIP安装mysql-client

```

pip install mysqlclient

```

你可能感兴趣的:(环境准备-MAC安装mysql-client)