I want to increase the Max Packet Size, I have edited the ‘my.cnf’ file. Is this the right way?
Assuming you are using something ubuntu-like, there is a main file for configuring all server-related settings:
You can see in your configfile that it imports all files in
50-server.cnf might already contain a line for max_allowed_packet that you can modify