Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

osx mariaDB how to set max_allowed_packet

I am trying to set 'max_allowed_packet' in 'my.cnf' which on my iMac is located in:

    /usr/local/etc/

I've tried:

    SET GLOBAL max_allowed_packet=1073741824;

I've also tried adding a section:

    [mysqld]
    SET GLOBAL max_allowed_packet=1073741824;

But neither have worked such that the setting is carried forward for reboots. If I open a terminal and enter:

    SET GLOBAL max_allowed_packet=1073741824;

Directly into the terminal it works find, but isn't kept on reboot, how do I resolve this?

like image 815
SPlatten Avatar asked Jun 10 '17 14:06

SPlatten


People also ask

What is max_allowed_packet MariaDB?

How does max_allowed_packet Function Work in MariaDB? Maximum size of max_allowed_packet is in bytes or it generates the intermediate string. In which we can set the packet message buffer value from the net_buffer_length but we can increase that value by using the max_allowed_packet bytes.

Where is max_allowed_packet?

You have two values of max_allowed_packet in MySQL : one on the client side : [mysql] section, [mysqldump] , [client] and more. one on the server side : [mysqld] section.

What should be max_allowed_packet?

In a nutshell, max_allowed_packet is the maximum size of a MySQL network protocol packet that the server can create or read. It has a default value of 1MB (<= 5.6. 5) or 4MB (>= 5.6. 6) and a maximum size of 1GB.

What is default max_allowed_packet?

The server's default max_allowed_packet value is 64MB. You can increase this if the server needs to handle big queries (for example, if you are working with big BLOB columns). For example, to set the variable to 128MB, start the server like this: $> mysqld --max_allowed_packet=128M.


1 Answers

The solution works when editing my.cnf, No need for SET GLOBAL prefix:

[mysqld]
max_allowed_packet=500M
like image 153
SPlatten Avatar answered Sep 22 '22 03:09

SPlatten