Opened 10 years ago

Closed 10 years ago

#44532 closed request (invalid)

Confusion regarding Mysql server went away

Reported by: JAyenGreen (Jeff Greenberg) Owned by: pixilla (Bradley Giesbrecht)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc:
Port: mysql5

Description

I have about a dozen site dev versions running on my macbook. I've been working on some custom code for one for a few months. I was tracing it in xdebug like usual tonight, and when I stopped it and went to 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, and can hit the other sites. 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 then rebooting when that didn't work, accomplished nothing.

my.cnf seems to be in /opt/local/etc/mysql5, and pretty much has nothing in it...is that right? I thought I'd check on this first.

Change History (3)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: mysql removed
Owner: changed from macports-tickets@… to pixilla@…

Yes, the mysql5 port looks for the my.cnf file in /opt/local/etc/mysql5, among other locations mentioned in the mysql documentation. However, the mysql5 port is deprecated; consider upgrading to one of the newer versions of mysql in the ports mysql55, mysql56, mariadb-10.0, mariadb-10.1, and percona.

comment:2 Changed 10 years ago by JAyenGreen (Jeff Greenberg)

I'd like to first resolve this error appearing before upgrading (so that I don't end up with the same problem after the effort). I already seem to have 5.5 on the system too, thought it's not being used apparently. When I run phpinfo() I get the following:

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 /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

This leads me to believe that I'm running mysql 5 and that it's the macports one.

However, when I run mysql client and enter:

show variables like "%version%";

I get:

+-------------------------+------------------------------+

| 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 |

+-------------------------+------------------------------+

Which seems to say 5.5 is running, instead. That said, the settings page (OSX 10.8.5) has MySql enabled, and when I disable it by clicking the button under Mysql, I no longer have access to it even from the command line until I enable it again.

Also, other than the macports source directories,

find / -name=my.cnf

inds only two, one in /opt/local/etc/mysql5 and the other in /opt/local/etc/mysql55.

I edited the one in mysql5 AND mysql55 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. But I don't know how to verify that it's actually present. The problem for me, in general, is that I don't know how to verify much of anything in this case.

comment:3 Changed 10 years ago by mf2k (Frank Schima)

Resolution: invalid
Status: newclosed

A "request" is only for requesting new ports. Trac is for bugs, new ports and enhancements. Tech support is handled by the Macports Users mailing list. Please move your question there where it is appropriate and where more people will see it.

Note: See TracTickets for help on using tickets.