title: Adding max_allowed_packet to my.cnf stops mysql server
body: <p>I do Drupal dev work on my Mac using a Homebrew setup for mysql, and on a couple version 6 sites, I get the famous "mysql: server has gone away" error when trying to bring up the status report page.  After doing some searching, I have found that the answer seems to be adding the max_allowed_packet settings to the [mysqld] section of my.cnf.  So, using the my-medium.cnf file provided in the mysql formula, I place it in /usr/local/etc and add</p>
  
  <pre><code>max_allowed_packet=65M
  </code></pre>
  
  <p>However, mysql does not like that for some reason.  I run mysql.server restart, and it seems to start, but when I try to run a query in my client, but it tells me there is no connection.  I then try removing the setting from my.cnf and restart, but instead of restarting, I get </p>
  
  <pre><code>ERROR! The server quit without updating PID file (/usr/local/var/mysql/username.home.pid)
  </code></pre>
  
  <p>Attempting to reconnect the socket gives me an error saying that either the request times out or unable to connect via the socket (/tmp/mysql.sock in this case).  On the Drupal site, I get a "No such file or directory." message.</p>
  
  <p>Can anyone explain why merely adding this value to my.cns causes such results?</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT:</strong> After examining the my.cnf I was using, I noticed that the [mysqld] section already had max_allowed_packet = 1M.  I removed it and created my.cnf that had only </p>
  
  <pre><code>[mysqld]
  max_allowed_packet = 64M
  </code></pre>
  
  <p>and I still get the same result.  For some reason, mysql doesn't like it when I add or change that setting.</p>