I want to test my program that coded into PGSQL, and PySQLite. With these
DBs I have problem on many blob deletion (2 hours) and compact/vacuum (1
So I'm trying to port my program, and before that making a test to check,
which time needs to delete 1 GB of blobs.
I installed MySQLDb from the exe (Py2.6, from stackoverflow version), set
all parameters, etc.
conn = MySQLdb.connect (host = "localhost",
user = "root",
passwd = "",
db = "db")
cursor = conn.cursor ()
cursor.execute ("SELECT VERSION()")
cursor.execute('delete from blobs;')
s = time.time()
for i in range(200):
k = str(i)
xbuffer = chr(65 + (i % 26))
xbuffer = xbuffer * 1024 * 1024
b = MySQLdb.escape_string(xbuffer)
cursor.execute('''insert into blobs
(blob_id, file_id, size, ext, data)
(%s, %s, %s, %s, %s)''', (i, i, -1, 'org', b))
e = time.time()
t = e - s
When I tried to start this, I got error:
_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')
I read that server have some parameter, that limit the Query length.
Then I decreased the blob size to 1M, and then it is working.
But: I can insert 800k-1,9 MB blobs.
I tried to set this parameter, but nothing changed.
max_allowed_packet = 16M
What is the problem? What I do wrong?
Thanks for your help: