SOLVED mariadb max_allowed_packet problem

vacancy

Well-Known Member
Sep 20, 2012
480
169
93
Turkey
cPanel Access Level
Root Administrator
Hello there

I set the max_allowed_packet value to 4GB for mariadb, but when mariadb is restarted, this value automatically becomes 1GB.

Tweak settings > Allow cPanel & WHM to determine the best value for your MySQL max_allowed_packet configuration? setting is set to off. In my.cnf content, max_allowed_packet value still shows 4G, but on mariadb cli this setting returns 1G.
 

Attachments

Last edited by a moderator:

HostNoc

Well-Known Member
Feb 20, 2020
93
17
8
Ontario
cPanel Access Level
Root Administrator
Hello,

Kindly change in the my.ini or ~/.my.cnf file by including the single line under [mysqld] or [client] section in your file:

max_allowed_packet=4G

then restart the MySQL service and you are done.

Let us know if this works for you.
 

vacancy

Well-Known Member
Sep 20, 2012
480
169
93
Turkey
cPanel Access Level
Root Administrator
It didn't work. Any value above 1G is not accepted, it automatically changes to 1G = 1073741824

Code:
MariaDB [(none)]> SHOW VARIABLES LIKE 'max_allowed_packet';
+--------------------+------------+
| Variable_name      | Value      |
+--------------------+------------+
| max_allowed_packet | 1073741824 |
+--------------------+------------+
1 row in set (0.001 sec)
 

vacancy

Well-Known Member
Sep 20, 2012
480
169
93
Turkey
cPanel Access Level
Root Administrator
I did a bunch of testing and no matter what I put the value kept capping out at 1G, so I figured I should go to the source.

I feel like this value used to be larger, but docs for MySQL 5.6 also show 1G max: MySQL :: MySQL 5.6 Reference Manual :: 5.1.7 Server System Variables
Yes, interestingly, this value can be used as a maximum of 1GB in mariadb, mysql 5.6, 5.7 and 8.

It had never caught my attention before, so I hope this thread helps others with the same problem.

Thank you.
 
  • Like
Reactions: cPRex