如何为 python 3.5.1 安装 mysql-connector?
How to install mysql-connector for python 3.5.1?
我使用的是 python 3.5.1,但在安装 mysql 连接器时遇到问题:
install --allow-external mysql-connector-python-rf mysql-connector-python-rf
不工作,mysql-connector-python-rf 的普通 pip 命令也不工作。我收到以下消息:
error: option --single-version-externally-managed not recognized
有什么想法吗?
到目前为止python 3.5.1
没有mysql-connector
,但是你可以使用pymysql将mysql连接到python 3.5.1!
import pymysql
conn = pymysql.connect(host='localhost', port=port_no, user='db_user', passwd='password', db='db_name')
我使用的是 python 3.5.1,但在安装 mysql 连接器时遇到问题:
install --allow-external mysql-connector-python-rf mysql-connector-python-rf
不工作,mysql-connector-python-rf 的普通 pip 命令也不工作。我收到以下消息:
error: option --single-version-externally-managed not recognized
有什么想法吗?
到目前为止python 3.5.1
没有mysql-connector
,但是你可以使用pymysql将mysql连接到python 3.5.1!
import pymysql
conn = pymysql.connect(host='localhost', port=port_no, user='db_user', passwd='password', db='db_name')