Can dynamic variable changes be written to the my.cnf

If I change the sort_buffer_size like this:

set global sort_buffer_size=16777216;

Is there away for that to automatically get written to the my.cnf?

I know its simple to just make the change to the my.cnf, but my boss is asking if the change can get pushed to the my.cnf. I don’t this it can be, but wanted to check here before I give him his answer.

Thank you!

No, its not possible. You have to add those entries manually in my.cnf. AFAIK, its possible in Oracle but not MySQL.