Connecting Tech Pros Worldwide Forums | Help | Site Map

Got a packet bigger than 'max_allowed_packet' error

Member
 
Join Date: May 2007
Posts: 101
#1: Sep 18 '08
Okay...

I got this error, so I thought, fine, I'll change the max_allowed_packet variable.

So, I went to the documentation, and found this
http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html

But, the command it gives you for changing the packet size variable doesn't work.

This command:
Expand|Select|Wrap|Line Numbers
  1. mysqld --max_allowed_packet=32M
gives me the "command not found" error.

So, I figured I would find the file (/etc/init.d) and go like this:

Expand|Select|Wrap|Line Numbers
  1. ./mysqld --max_allowed_packet=32M
But that just gives me the "usage ./mysqld {star|stop|status|etc}" error.

But if I do this:
Expand|Select|Wrap|Line Numbers
  1. ./mysqld start --max_allowed_packet=32M
It won't take in the argument for max_allowed_packet, because I can spell the variable wrong and it doesn't give me an error.

This is getting pretty frustrating. Anyone know how I can change the server variable "max_allowed_packet"?

Member
 
Join Date: May 2007
Posts: 101
#2: Sep 18 '08

re: Got a packet bigger than 'max_allowed_packet' error


I found an alternative.

1. Edit the file "/etc/my.cnf":
Under "[mysqld]", enter "max_allowed_packet=100000000M"

2. Then use command:
mysql -p'<password>' --max_allowed_packet=10000000M <database_name> < "/home/<user>/Desktop/<upload_file>.sql"
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#3: Sep 18 '08

re: Got a packet bigger than 'max_allowed_packet' error


Yea. But after changing it in the my.cnf file and restarting the MySQL server, it shouldn't be necessary to add the parameter to the mysql command.

Glad you found a solution tho.
Thanks for sharing it.
Reply