I have a photo management system that I have build locally which uses mysql to store the images. the problem is that I exceed the max_allowed_packet value when my images are too large. I know how to set the max_allowed_packet value through the CLI with:

SET GLOBAL max_allowed_packet=16*1024*1024*1024;

The problem is that when mysql is restarted or I reboot, this value is reset. Where can I make this change permanent?

Edit: BTW, I don't know if it makes a difference but I am on a mac.