Python connect to sqllite database

import sqlite3
conn = sqlite3.connect("/var/lib/grafana/grafana.db") # connect to the database 
cursor = conn.cursor() # create a cursor 
cursor.execute("select id from user where name = '%s'"% user_name) # execute the statement 
user_id = cursor.fetchall() # get the result

Guess you like

Origin blog.csdn.net/MasterD56/article/details/108405277