赞
踩
MySQL官方提供了mysql-connector-python驱动
安装驱动
python -m pip install mysql-connector
连接数据库获取连接
import mysql.connector db = mysql.connector.connect( host="localhost", #ip user="root",