Modify the max_allowed_packet property of MySQL 5.5

  • 2020-06-01 11:10:02
  • OfStack

When deploying a test system today, the following error was reported:

Your 'max_allowed_packet' variable is set to less than 16777216 Byte (16MB).

It is also easy to understand that you need to modify the MySQL configuration file 1, but there is a little trick (in Windows 7) : if you use notepad or notepad++ to open my.ini at the bottom of MySQL 5.5, you will be prompted that the file is occupied by another program, or denied access, etc. (" please check if this file opended in another program "). If the MySQL service has been stopped, then it is not really a problem of program occupancy. The solution is simple, too. First, in the MySQL 5.5 installation directory, cut my.ini somewhere else, and you will be asked to continue as an administrator.

Then, in the MySQL 5.5 installation directory, there are many files similar to my.ini, such as my-small.ini. Use the administrator's identity to launch some text editing software (such as notepad++). Open both my.ini and my-small.ini.
 
[mysqldump] 
quick 
max_allowed_packet = 16M 

Copy to the my.ini file, and you can save it successfully. Then we can use the administrator identity to copy to the MySQL 5.5 installation directory.

It's as simple as that. Just record 1.

Related articles: