1. 游标的executescript,execuemany 查询结果的 fetcachall,fetchone,fetchmanyimport sqlite3conn=sqlite3.connect('D:/test.db')c=conn.cursor()sql='''create table i...
分类:
数据库 时间:
2015-08-13 13:47:52
阅读次数:
163
[root@zabbix_server ~]# cat aa.py import MySQLdbconn=MySQLdb.connect(host='ip',user='xxx',passwd='xxx',port=xxx,db='xxxx',charset='utf8')cursor =conn....
分类:
数据库 时间:
2015-08-10 19:36:11
阅读次数:
322
程序这东西 ,比如Python用数据库这两句话
cur = handle_71.cursor( MySQLdb.cursors.DictCursor)
cur.execute(sql)
result = cur.fetchone()
我曾今每天复制,每天复制,复制了 一年后 ,我还是自己写不出来。
今天我自己敲了...
分类:
其他好文 时间:
2015-05-22 11:41:40
阅读次数:
121
在/usr/shared/dstat目录下dstat_mysql5_conn.py中的部分源代码c = self.db.cursor()c.execute("""show global variables like 'max_connections';""")max = c.fetchone()c....
分类:
数据库 时间:
2014-07-22 22:51:36
阅读次数:
252