Jesper Wisborg Krogh
Team Leader • Certified MySQL 5.0 Developer & DBA
Noggin IT • Level 8, 28 Foveaux St, Surry Hills NSW Australia 2010
T: +61 2 9219 8800 • F: +61 2 9280 4669 • E: jes...@noggin.com.au
http://www.noggin.com.au

On 21/02/2010, at 4:46 AM, Paul DuBois wrote:


On Feb 20, 2010, at 11:22 AM, Vikram A wrote:

Hi experts,

When I try to set the packet size to some other value, it is not getting updated.
show variables;

set max_allowed_packet = 2097152;
set global max_allowed_packet = 2097152;

it resulting,
Query is ok, 0 rows afected (0.00 sec)

That's okay. What does this query return:

mysql> select @@global.max_allowed_packet;
+-----------------------------+
| @@global.max_allowed_packet |
+-----------------------------+
|                     2097152 |
+-----------------------------+
1 row in set (0.06 sec)

Also remember, when you change a global variable, the change won't effect existing connections, so you will need to log out and back in to see the change. Setting the session variable as well will solve that for the existing connection, but not for other long lived connections:

With mysql1> and mysql2> being two different connections:

mysql1> select @@session.max_allowed_packet, @@global.max_allowed_packet;
+------------------------------+-----------------------------+
| @@session.max_allowed_packet | @@global.max_allowed_packet |
+------------------------------+-----------------------------+
|                      1048576 |                     1048576 |
+------------------------------+-----------------------------+
1 row in set (0.00 sec)

mysql2> select @@session.max_allowed_packet, @@global.max_allowed_packet;
+------------------------------+-----------------------------+
| @@session.max_allowed_packet | @@global.max_allowed_packet |
+------------------------------+-----------------------------+
|                      1048576 |                     1048576 |
+------------------------------+-----------------------------+
1 row in set (0.00 sec)

mysql1> set global max_allowed_packet = 2097152;
Query OK, 0 rows affected (0.00 sec)

mysql1> select @@session.max_allowed_packet, @@global.max_allowed_packet;
+------------------------------+-----------------------------+
| @@session.max_allowed_packet | @@global.max_allowed_packet |
+------------------------------+-----------------------------+
|                      1048576 |                     2097152 |
+------------------------------+-----------------------------+
1 row in set (0.00 sec)

mysql2> select @@session.max_allowed_packet, @@global.max_allowed_packet;
+------------------------------+-----------------------------+
| @@session.max_allowed_packet | @@global.max_allowed_packet |
+------------------------------+-----------------------------+
|                      1048576 |                     2097152 |
+------------------------------+-----------------------------+
1 row in set (0.00 sec)

Jesper



Can you suggest me how set this value to higher one. By default it is 1 MB.

Thank you

VIKRAM A

--
Paul DuBois
Sun Microsystems / MySQL Documentation Team
Madison, Wisconsin, USA
www.mysql.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub=jes...@noggin.com.au


Reply via email to