Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: MySQLdb executemany

Reply
Thread Tools

Re: MySQLdb executemany

 
 
Daniel Bowett
Guest
Posts: n/a
 
      01-26-2005
Daniel Bowett wrote:
> I seem to have found a bug/limitation of executemany in MySQLdb.
>
> I am inserting 3100 records into a database. It works fine and adds them
> in about 1 second.
>
> I went back to the program today and realised i'd missed a field so
> added it to the insert statement. This seems to break it if I try to add
> all the records in one go. Through trial and error I have realised the
> limit is 2786 records in one go. Any more than that I get two different
> errors on the executemany statement:
>
> "MySQL server has gone away" - This occurs if I try to add all 3100
> records in one go.
>
> "Lost Connection to MySQL server during query" - This happens if I am
> near the 2786 threshold.
>
> Is there a known limit with this function???
>


UPDATE
------

The maximum packet size in mysql by default is 1MB. Hence why I was
hitting ths problem.

http://dev.mysql.com/doc/mysql/en/packet-too-large.html

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PEP 249 (database api) -- executemany() with iterable? Roy Smith Python 24 10-17-2010 12:02 AM
Re: using sqlite3 - execute vs. executemany; committing ... David Python 0 05-07-2008 07:04 AM
cursor.executemany() float error progman Python 2 12-03-2006 02:50 PM
MySQLdb module, method executemany with anything other than strings? olekristianvillabo@gmail.com Python 2 08-25-2005 12:11 PM
MySQLdb executemany Daniel Bowett Python 0 01-26-2005 06:42 PM



Advertisments