python 3.5.2安裝mysql驅(qū)動(dòng)時(shí)出現(xiàn)如下異常:
[root@localhost www]# pip install mysql-connector-python
Collecting mysql-connector-python
Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
這是由于官方驅(qū)動(dòng)暫時(shí)只支持到python3.4所致戈鲁。改用pymysql
安裝pymysql
pip install PyMySQL
然后在項(xiàng)目根目錄的init.py里添加
import pymysql
pymysql.install_as_MySQLdb()
意思是將pymysql安裝位mysql的默認(rèn)數(shù)據(jù)庫驅(qū)動(dòng)