Increase Max Packet Size

I want to increase the Max Packet Size, I have edited the ‘my.cnf’ file. Is this the right way?

Hi,

Assuming you are using something ubuntu-like, there is a main file for configuring all server-related settings: /etc/mysql/mysql.conf.d/50-server.cnf.

You can see in your configfile that it imports all files in /etc/mysql/mysql.conf.d/ and 50-server.cnf might already contain a line for max_allowed_packet that you can modify