 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
How to 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
 