0

I want to set max_allowed_packet parameter in runtime. The

SET GLOBAL max_allowed_packet = 16777216

works for new connections, but after database server restart, it has previous value. Can value of the max_allowed_packet in runtime for new connection and restart of database server will not affect this value?

Thank you.

  • 1
    set the value again globally and add the new value in config file so after restart it comes back to what you want or you can use init_file and set the value of your need in it as it would be read at instance start-up – Nawaz Sohail Apr 6 '16 at 14:55
1

Setting in the command line are not persisted anywhere. Therefore after a restart it resets to default or picks up the value from the config file.

Put the following line into your my.cnf file under the [mysqld] section:

max_allowed_packet = 16777216

About how to find what file is used you can find some resources here on stack exchange as well:

https://stackoverflow.com/questions/2482234/how-to-know-mysql-my-cnf-location

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.