pip install MySQL-python
import MySQLdb, os
try:
conn = MySQLdb.connect(host='172.17.42.1', user='数据库访问用户...', passwd='数据库访问密码', db='数据库名', port=3306)
cur = conn.cursor()
cur.execute('SELECT `id`, `name`, `path...`, FROM `doc_file`')
# 获取全部记录
results=cur.fetchall()
for r in results:
id, name, path = r[0], r[...wishing you all the success in your business. suzuki coin
wind-zz 4年前
phyton语言
cheonghu 5年前 0
#连接数据库