Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Problem with "packet bigger than 'max_allowed_packet' error"

    Hi
    I am running an update to a database and I keep getting this error:

    Could not Insert to CB_MAIN (update)Got a packet bigger than 'max_allowed_packet' bytes
    And it is from this code:[PHP]
    $result_upd = mysql_query($sql_upd) or write_error("Could not Insert to CB_MAIN (update)".mysql_error()." \r\n");

    The write_error() function writes to a log and on line no. 79,870 I get that error.

    Searched and read this:

    You probably have to change it for both the client (you are running to do the import) AND the daemon mysqld that is running and accepting the import.
    But didn't understand it.

    My system is as follows:

    Operating system CentOS Linux 6.0
    Perl version 5.010001
    Path to Perl /usr/bin/perl
    BIND version 9.7.0
    Postfix version 2.6.6
    Apache version 2.2.15
    PHP version 5.3.2
    Webalizer version 2.21-02
    Logrotate version 3.7.8
    MySQL version 5.1.52

    Would much appreciate it if some would help me by telling me what config files need to be changed and where they might be.

    Thanks.


    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Can someone help me out on this ?

    Thanks
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,354
    Thanks
    23
    Thanked 618 Times in 617 Posts
    I am not an expert here and only answer because this question has been without an answer for a long time.

    Your error is explained on this page of the mysql manual: http://dev.mysql.com/doc/refman/5.5/...too-large.html It basically says
    The largest possible packet that can be transmitted to or from a MySQL 5.5 server or client is 1GB. When a MySQL client or the mysqld server receives a packet bigger than max_allowed_packet bytes, it issues a Packet too large error and closes the connection.
    The mysqld also known as the MySQL Server is limited to 1Mb. They then say it's possible to increase this through CMD start command.

    Looking in the ini file for my php I came to this section:
    # The MySQL server
    [wampmysqld]
    port = 3306
    socket = /tmp/mysql.sock
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    basedir=c:/wamp/bin/mysql/mysql5.5.16
    log-error=c:/wamp/logs/mysql.log
    datadir=c:/wamp/bin/mysql/mysql5.5.16/data
    If you can, change this line
    max_allowed_packet = 1M
    to 8M or 16M or 32M. As you can see my setup is on my computer and I use WAMP so your milage my be different.
    Good Luck and Happy New Year.

  • #4
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks for helping out

    What confuses me is the this:

    The largest possible packet that can be transmitted to or from a MySQL 5.5 server or client is 1GB.
    So both are capable of the same ?

    When a MySQL client or the mysqld server receives a packet bigger than max_allowed_packet bytes, it issues a Packet too large error and closes the connection.
    Which one is being changed by the php.ini file ?
    The client or the server s/w?

    BTW I have increased the php.ini value up to 32MB

    I see what happens

    Thanks again.



    .
    Last edited by jeddi; 01-03-2012 at 06:39 PM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #5
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    You want to change the my.cnf file for your MySQL installation. Delete any lines with max_allowed_packet= and put in max_allowed_packet=32M (change the figure to suit). Restart MySQL and you should be set.

    Reference:
    http://dev.mysql.com/doc/refman/5.0/...allowed_packet
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •