Koozali.org: home of the SME Server

Mysql max_allowed_packet

Offline beast

  • *
  • 238
  • +0/-0
Mysql max_allowed_packet
« on: August 15, 2021, 08:31:54 AM »
Hi All

If I execute:

SHOW VARIABLES LIKE 'max_allowed_packet';

I get the value 4194304 (in phpmyadmin)

I I try to edit /etc/e-smith/templates/etc/my.cnf/011max-allowed-packet

to a higher value (default 16M) and then execute:

expand-template /etc/my.cnf
systemctl restart mariadb.service

Have also tried to reboot.

The value stay the same - why?

/Benny

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mysql max_allowed_packet
« Reply #1 on: August 15, 2021, 10:13:37 AM »
I'm not sure why this occurs, but after all these years you should know not to edit default templates and use custom-templates instead.

Examples are in the wiki.

https://wiki.koozali.org/MySQL

Other people will read this, try to copy it and then wonder why things break.

Also read this to fully understand what you are doing and why it might not be working as you expect.

https://dba.stackexchange.com/questions/45087/max-allowed-packet-in-mysql

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mysql max_allowed_packet
« Reply #2 on: August 15, 2021, 03:47:56 PM »
I think you need to be looking in # /etc/e-smith/templates/etc/my.cnf014server_system_variables

and perhaps adding a property and value to

# config show mariadb
mariadb=service
    LocalNetworkingOnly=no
    status=enabled

# config setprop mariadb MaxAllowedPacket 8M

# config show mariadb
mariadb=service
    LocalNetworkingOnly=yes
    MaxAllowedPacket=8M
    status=enabled

MariaDB [(none)]> SHOW VARIABLES LIKE 'max_allowed_packet';
+--------------------+---------+
| Variable_name      | Value   |
+--------------------+---------+
| max_allowed_packet | 8388608 |
+--------------------+---------+
1 row in set (0.00 sec)

Will need to expnad templates etc, I did a reconfig and reboot to make sure..
--
qui scribit bis legit

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Mysql max_allowed_packet
« Reply #3 on: August 15, 2021, 10:17:40 PM »
there is a bug there, you need to open a bug against sme 10.0 for e-smith-mysql package

the variable is defined in 2 fragments

Code: [Select]
# grep max_allowed_packet /etc/e-smith/templates/etc/my.cnf/ -r
/etc/e-smith/templates/etc/my.cnf/011max_allowed_packet:max_allowed_packet=16M
/etc/e-smith/templates/etc/my.cnf/014server_system_variables:    $OUT .= "max_allowed_packet=$var\n" if defined $var;


also
SHOW VARIABLES LIKE 'max_allowed_packet';

I get the value 4194304 (in phpmyadmin)

well this seems that mariadb is ignoring the setting you see  in my.conf or something has changed it at runtime... you need to read mariadb manual or inspect what software might have changed it

https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet


and

I I try to edit /etc/e-smith/templates/etc/my.cnf/011max-allowed-packet

do not edit templates, use templates customs...
you make it harder for you to know what you did on your server leaving it in an unknown state, and if you are happy with you change you leave yourself ignoring when this change will be overwritten by update...

Offline beast

  • *
  • 238
  • +0/-0
Re: Mysql max_allowed_packet
« Reply #4 on: August 17, 2021, 07:47:22 AM »
Hi All

Thank you for the suggestions - I will look into it.

I know that I shall make custom templates. I am just trying to find out why I am unable to change the setting.

/Benny

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Mysql max_allowed_packet
« Reply #5 on: August 17, 2021, 09:33:04 AM »
because that template fragment you are trying to set using a custom template is being overridden by the fragment I listed, 014server_system_variables, it sets a number of my.cnf settings for mariadb settings..

Added: have a look at the my.cnf file, there are two entries for max_allowed_packet=
The last sets it, this is one created by the temp fragment 014server_system_variables
« Last Edit: August 17, 2021, 09:39:41 AM by TerryF »
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Mysql max_allowed_packet
« Reply #6 on: August 17, 2021, 05:20:11 PM »
Should be fixed but needs testing/verifying please.

https://bugs.koozali.org/show_bug.cgi?id=11672
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation