首页
技术博客
登录
6mi
u
盘
搜
搜 索
技术博客
Python 连接 sqllite数据库
Python 连接 sqllite数据库
tech
2026-02-21
2
import sqlite3 conn = sqlite3.connect("/var/lib/grafana/grafana.db") # 连接数据库 cursor = conn.cursor() # 创建游标 cursor.execute("select id from user where name = '%s'"% user_name) # 执行语句 user_id = cursor.fetchall() # 拿到结果
转载请注明原文地址:https://tech.qufami.com/read-26938.html
最新回复
(
0
)