Weird happenings with mysql
Jeff Greenberg
listmail.ayendesigns at gmail.com
Tue Aug 5 19:12:41 PDT 2014
I have several dev sites running on my macbook. I'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:
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone
away.
- I can connect to the db via mysql command line and Sequel Pro
- I can hit the other sites without an issue
Everything I read about this error seems to point to the timeout and/or
packet size settings in my.cnf. I don't know why they would all of a sudden
be a problem, but I figured I'd try upping them, since restarting the
service, and rebooting when that didn't work, accomplished nothing.
My bigger point of confusion is WHERE to do this or even how to confirm
what I'm running. I thought I was running mysql 5, as that'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 'which mysql' 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.
Also, other than the macports source directories,
find / -name=my.cnf
finds only two, one in /opt/local/etc/mysql5 and the other in
/opt/local/etc/mysql55.
I edited both, adding:
[mysqld] max_allowed_packet=100M
and restarted apache and mysql. there is no new row appearing in phpinfo()
with that setting, and it didn't make a difference.
phpinfo output:
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version mysqlnd 5.0.8-dev - 20102224 - $Id:
731e5b87ba42146a687c29995d2dfd8b4e40b325 $
Directive Local Value Master Value
mysql.allow_local_infile On On
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket /opt/local/var/run/mysql5/mysqld.sock
/opt/local/var/run/mysql5/mysqld.sock
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off
mysqli
MysqlI Support enabled
Client API library version mysqlnd 5.0.8-dev - 20102224 - $Id:
731e5b87ba42146a687c29995d2dfd8b4e40b325 $
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Directive Local Value Master Value
mysqli.allow_local_infile On On
mysqli.allow_persistent On On
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket
/opt/local/var/run/mysql5/mysqld.sock
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.max_persistent Unlimited Unlimited
mysqli.reconnect Off Off
mysqlnd
mysqlnd enabled
Version mysqlnd 5.0.8-dev - 20102224 - $Id:
731e5b87ba42146a687c29995d2dfd8b4e40b325 $
Compression supported
SSL supported
Command buffer size 4096
Read buffer size 32768
Read timeout 31536000
Collecting statistics Yes
Collecting memory statistics Yes
Tracing n/a
mysql client: show variables like "%version%";
+-------------------------+------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------+
| innodb_version | 1.1.8 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.5.15 |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | i386 |
| version_compile_os | osx10.6 |
+-------------------------+------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20140805/847145e7/attachment.html>
More information about the macports-users
mailing list