Python 连接 MySQL 数据库
-
使用
import mysql.connector as con
导入 MySQL 连接器 -
创建
connect_db
函数,传入数据库名、用户名和密码 -
使用
con.connect
建立连接 -
返回连接对象
660B
文件大小:
评论区