from MySQLdb import connect, DatabaseError, cursors _c = connect(read_default_file = "/home/mmokrejs/.my.cnf", read_default_group = 'test') _cursor = _c.cursor() _size = 8000 while _size < 20000: _str = _size * 'A' _cursor.execute("INSERT into sequence (sequence_string) values ('" + _str + "')") id = str(_cursor.lastrowid) _c.commit() _c.rollback() print "reading row", str(id), "with sequence_string long", str(_size), "chars." _cursor.execute("SELECT sha1, md5, size, sequence_id, sequence_string FROM sequence WHERE sequence_id=" + str(id)) s = _cursor.fetchall() # print s _size += 1