Re: MySQLdb executemany

Discussion in 'Python' started by Daniel Bowett, Jan 26, 2005.

  1. 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
     
    Daniel Bowett, Jan 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bowett

    MySQLdb executemany

    Daniel Bowett, Jan 26, 2005, in forum: Python
    Replies:
    0
    Views:
    559
    Daniel Bowett
    Jan 26, 2005
  2. Replies:
    2
    Views:
    529
  3. progman

    cursor.executemany() float error

    progman, Dec 3, 2006, in forum: Python
    Replies:
    2
    Views:
    770
    progman
    Dec 3, 2006
  4. David
    Replies:
    0
    Views:
    361
    David
    May 7, 2008
  5. Roy Smith
    Replies:
    24
    Views:
    923
    Martin Gregorie
    Oct 17, 2010
Loading...

Share This Page