摘要:
Class cursor.MySQLCursorBuffered该类从Class cursor.MySQLCursorBuffered继承,如果需要,可以在执行完SQL语句后自动缓冲结果集合。import mysql.connectorcnx = mysql.connector.connect()# Only this particular cursor will buffer resultscnx.cursor(buffered=True)# All cursors will be buffering by defaultcnx2 = mysql.connector.connect(buff 阅读全文
摘要:
连接mysql数据库:cnx = mysql.connector.connect(user='joe', database='test') Connector/Python参数列表Argument NameDefaultDescriptionuser(username*)The user name used to authenticate with the MySQL server.password(passwd*)The password to authenticate the user with the MySQL server.database(db*)T 阅读全文
摘要:
BLOB是一个二进制大对象,可以容纳可变数量的数据。有4种BLOB类型:TINYBLOB、BLOB、MEDIUMBLOB和LONGBLOB。它们只是可容纳值的最大长度不同。A binary large object that can hold a variable amount of binary data. The sorting and comparison of the values for these objects is performed in case-sensitive manner.TINYBLOBA binary large object column with a max 阅读全文
摘要:
最近做一些数据库调研的工作,目标是实现影像更快的入库、出库、查询,并实现并行访问等操作。将结果总结成一个mongoImg类,也算是小结吧。 1 ''' 2 Created on 2013-8-6 3 class mongoInsert 4 @author: tree 5 ''' 6 __metacl... 阅读全文
摘要:
将一个py脚本从Centos转到win运行,出错如下:UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte sequence虽然明白是编码的问题,网络上decode()什么的,貌似不适用python3。后来发现使用字节方式打开可以。出错函数如下:gridfs.GridFS.put()函数。其中调用了读写操作If you want raw bytes then you need to open it in binary mode.pipe = open 阅读全文