max_allowed_packet on Mac OS X MySQL

While developing a Ruby on Rails application that supported attachments, I ran into an error to the effect, "size exceeds max_allowed_packet". This is because the default installation of MySQL does not accept network packets exceeding 1MB in length.

The solution involves using the MySQL Administrator tool. This is a useful program available as a separate package from MySQL. Unfortunately, it is not very user friendly.

  1. Click the "Options" button in the top navigation strip
  2. Choose "Advanced Networking" from the dropdown
  3. Click the pencil icon next to "Max. packet size:". The words will turn from (disabled) gray to (enabled) black.
  4. Adjust the size using the text box, arrows, or dropdown.
  5. Click save. By default, there is no configuration file, so you may be asked to enter administrator credentials to create or modify the file.

The interface allows you to skip 3. and do 4. and 5. without complaint, but the configuration will not be changed. The change can be verified by re-launching the MySQL Administrator and by viewing the contents of /etc/my.cnf.

MySQL Administrator

Tags: Technical

Updated at: 13 August 2009 8:08 AM