Jump to content
xisto Community
Sign in to follow this  
spotok

Max_allowed_packet In MySQL Setting of max_allowed_packet in Mysql

Recommended Posts

hi, in Mysql not only you can keep text or numbers but also you can keep files even of 50MB size.. for this to work you should set the Max_allowed_packet.. and you are done,,here is the procedure i have got for getting it done..==========================A.2.9. Packet too largeA communication packet is a single SQL statement sent to the MySQL server or a single row that is sent to the client. In MySQL 3.23, the largest possible packet is 16MB, due to limits in the client/server protocol. In MySQL 4.0.1 and up, the limit 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. With some clients, you may also get a Lost connection to MySQL server during query error if the communication packet is too large. Both the client and the server have their own max_allowed_packet variable, so if you want to handle big packets, you must increase this variable both in the client and in the server. If you are using the mysql client program, its default max_allowed_packet variable is 16MB. That is also the maximum value before MySQL 4.0. To set a larger value from 4.0 on, start mysql like this: mysql> mysql --max_allowed_packet=32MThat sets the packet size to 32MB. The server's default max_allowed_packet value is 1MB. You can increase this if the server needs to handle big queries (for example, if you are working with big BLOB columns). For example, to set the variable to 16MB, start the server like this: mysql> mysqld --max_allowed_packet=16MBefore MySQL 4.0, use this syntax instead: mysql> mysqld --set-variable=max_allowed_packet=16MYou can also use an option file to set max_allowed_packet. For example, to set the size for the server to 16MB, add the following lines in an option file: [mysqld]max_allowed_packet=16MBefore MySQL 4.0, use this syntax instead: [mysqld]set-variable = max_allowed_packet=16MIt's safe to increase the value of this variable because the extra memory is allocated only when needed. For example, mysqld allocates more memory only when you issue a long query or when mysqld must return a large result row. The small default value of the variable is a precaution to catch incorrect packets between the client and server and also to ensure that you don't run out of memory by using large packets accidentally. You can also get strange problems with large packets if you are using large BLOB values but have not given mysqld access to enough memory to handle the query. If you suspect this is the case, try adding ulimit -d 256000 to the beginning of the mysqld_safe script and restarting mysqld. =============================hope you like it..

Share this post


Link to post
Share on other sites

hi,

in Mysql not only you can keep text or numbers but also you can keep files even of 50MB size..

for this to work you should set the Max_allowed_packet.. and you are done,,

 

here is the procedure i have got for getting it done..

 

==========================

A.2.9. Packet too large

A communication packet is a single SQL statement sent to the MySQL server or a single row that is sent to the client.

 

In MySQL 3.23, the largest possible packet is 16MB, due to limits in the client/server protocol. In MySQL 4.0.1 and up, the limit is 1GB.

 

<{POST_SNAPBACK}>


Thanks for sharing it with us ;) - but thats not quite the right idea.

 

The max_allowed_packet option specifies how large your MySQL Query/Data Packet can be, and NOT the Maximum File Size that MySQL can maintain. MySQL can theoretically handle database files upto 1 Terrabyte in size.

 

Your article demonstrates that the recent versions of MySQL server can respond to Querries and the MySQL Client can receive data packets - both of which are around 1GB in size... so there ;)

 

Have fun mucking around with MySQL... refer to the my.cnf file that I've posted, for your initial setup, if you need to..

All the best

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.