
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Change Max Allowed Packet Size in MySQL
The max_allowed_packet size is a session variable and is also a read only variable.
To check what is the present value of max_allowed_packet, the command show variables is used. It is given as follows −
mysql> show variables like 'max_allowed_packet';
The following is the output
+--------------------+---------+ | Variable_name | Value | +--------------------+---------+ | max_allowed_packet | 4194304 | +--------------------+---------+ 1 row in set (0.04 sec)
The value of the max_allowed_packet can be changed in the ‘my.ini’ file on the client side. The query for that is given as follows −
max_allowed_packet = 4567890;
Now, the value can be changed globally with the help of the following query −
mysql> set global max_allowed_packet=456789; Query OK, 0 rows affected, 1 warning (0.00 sec)
After restarting the server, we will get the changed value.
Advertisements