python2.7数据库中间件使用mysql-python,进入python虚拟环境,通过pip install mysql-python安装
python3使用pymysql,进入虚拟环境,通过pip install pymysql安装
安装完成后,在数据库连接时,要将驱动器设置成相应的名称:
python2.7:
DRIVER = "mysqldb"
python3:
DRIVER = "pymysql"
https://blog.csdn.net/zinnc/article/details/53779196