<div dir="ltr"><p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif;background-color:rgb(238,238,238)">I have several dev sites running on my macbook. I&#39;ve been working on some custom code for one for a few months, and was tracing it in xdebug like usual, and when I stopped it and hit the page again, I got the error:</p>
<p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif;background-color:rgb(238,238,238)"> PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away.</p>
<p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif;background-color:rgb(238,238,238)">- I can connect to the db via mysql command line and Sequel Pro<br>- I can hit the other sites without an issue</p>
<p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif;background-color:rgb(238,238,238)">Everything I read about this error seems to point to the timeout and/or packet size settings in my.cnf. I don&#39;t know why they would all of a sudden be a problem, but I figured I&#39;d try upping them, since restarting the service, and rebooting when that didn&#39;t work, accomplished nothing.<br>
</p><p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif;background-color:rgb(238,238,238)">My bigger point of confusion is WHERE to do this or even how to confirm what I&#39;m running. I thought I was running mysql 5, as that&#39;s what phpinfo() seems to say (details below). But when I run the mysql client and check there, it seems to be mysql 5.5 (both are on my system in /opt/local). Further, though &#39;which mysql&#39; points to /opt/local, starting and stopping the service is accomplished via a mysql page with a button via the OSX (10.8.5) settings page. When it is off, there is no mysql client available.</p>
<p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">Also, other than the macports source directories,<br></p><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>find / -name=my.cnf</p></blockquote><p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">finds only two, one in /opt/local/etc/mysql5 and the other in /opt/local/etc/mysql55.</p>
<p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">I edited both, adding:</p><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>[mysqld] max_allowed_packet=100M</p></blockquote><p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">and restarted apache and mysql. there is no new row appearing in phpinfo() with that setting, and it didn&#39;t make a difference. </p>
<p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif;background-color:rgb(238,238,238)">phpinfo output:</p><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>mysql</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif"><p>MySQL Support enabled<br>Active Persistent Links 0<br>Active Links 0<br>
Client API version mysqlnd 5.0.8-dev - 20102224 - $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $<br>Directive Local Value Master Value<br>mysql.allow_local_infile On On<br>mysql.allow_persistent On On<br>mysql.connect_timeout 60 60<br>
mysql.default_host no value no value<br>mysql.default_password no value no value<br>mysql.default_port no value no value<br>mysql.default_socket /opt/local/var/run/mysql5/mysqld.sock /opt/local/var/run/mysql5/mysqld.sock<br>
mysql.default_user no value no value<br>mysql.max_links Unlimited Unlimited<br>mysql.max_persistent Unlimited Unlimited<br>mysql.trace_mode Off Off</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>mysqli</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif"><p>MysqlI Support enabled<br>Client API library version mysqlnd 5.0.8-dev - 20102224 - $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $<br>
Active Persistent Links 0<br>Inactive Persistent Links 0<br>Active Links 0<br>Directive Local Value Master Value<br>mysqli.allow_local_infile On On<br>mysqli.allow_persistent On On<br>mysqli.default_host no value no value<br>
mysqli.default_port 3306 3306<br>mysqli.default_pw no value no value<br>mysqli.default_socket<br>/opt/local/var/run/mysql5/mysqld.sock <br>mysqli.default_user no value no value<br>mysqli.max_links Unlimited Unlimited<br>mysqli.max_persistent Unlimited Unlimited<br>
mysqli.reconnect Off Off</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif"><p>mysqlnd</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>mysqlnd enabled<br>Version mysqlnd 5.0.8-dev - 20102224 - $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $<br>Compression supported<br>SSL supported<br>Command buffer size 4096<br>Read buffer size 32768<br>Read timeout 31536000<br>
Collecting statistics Yes<br>Collecting memory statistics Yes<br>Tracing n/a</p></blockquote><p style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">mysql client: show variables like &quot;%version%&quot;;</p>
<blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif"><p>+-------------------------+------------------------------+</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>| Variable_name | Value |</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif"><p>+-------------------------+------------------------------+</p>
</blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif"><p>| innodb_version | 1.1.8 |<br>| protocol_version | 10 |<br>| slave_type_conversions | |<br>
| version | 5.5.15 |<br>| version_comment | MySQL Community Server (GPL) |<br>| version_compile_machine | i386 |<br>| version_compile_os | osx10.6 |</p></blockquote><blockquote style="font-size:13px;color:rgb(0,0,0);font-family:&#39;Lucida Grande&#39;,Verdana,Arial,Helvetica,sans-serif">
<p>+-------------------------+------------------------------+</p><div><br></div></blockquote>
</div>