sqlite3
sqlite = sqlite3.connect('/root/test.db') #里边要数据库的文件路径 cxn = MySQLdb.connect(user='root',passwd='root',db='hei_admin') | close(...) | Closes the connection. | | commit(...) | Commit the current transaction. | cursor(...) | Return a cursor for the connection. | | execute(...) | Executes a SQL statement. Non-standard. | | executemany(...) | Repeatedly executes a SQL statement. Non-standard. | | executescript(...) | Executes a multiple SQL statements at once. Non-standard. | | rollback(...) | Roll back the current transaction. execute() 执行一个语句 executemany() 执行一组语句 fetchone() fetchmany() fetchall() close() next() 相当于fetchone lastrowid rowcount arraysize