mysql51-server socket

Ryan Schmidt ryandesign at macports.org
Thu Jun 21 22:04:23 PDT 2012


On Jun 21, 2012, at 09:15, Craig Treleaven wrote:

> Hi:
> 
> I was testing a fresh install of mysql51-server (on 10.7.4) and I'm having a problem that the socket is not where it is supposed to be:
> 
>> $ mysql5 < /opt/local/share/mythtv/database/mc.sql
>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
>> 
>> $ mysql_config5 --socket
>> /opt/local/var/run/mysql5/mysqld.sock

The mysql5 and mysql_config5 programs are from the mysql5 port. And /opt/local/var/run/mysql5/mysqld.sock is where the mysql5-server program would place its socket by default, though you can override it by editing /opt/local/etc/mysql5/my.cnf.


>> $ ls -al /opt/local/var/run/mysql5/mysqld.sock
>> ls: /opt/local/var/run/mysql5/mysqld.sock: No such file or directory
>> 
>> $ ls -al /opt/local/var/run/mysql51
>> total 0
>> drwxr-xr-x  4 _mysql  _mysql  136 21 Jun 08:50 .
>> drwxr-xr-x  5 root    admin   170 21 Jun 09:06 ..
>> -rw-r--r--  1 root    _mysql    0  3 May 14:22 .turd_mysql51-server
>> srwxrwxrwx  1 _mysql  _mysql    0 21 Jun 08:50 mysqld.sock
> 
> I tried to use /opt/local/etc/mysql51/my.cnf to indicate the socket:
>> # Use default MacPorts settings
>> !include /opt/local/etc/mysql51/macports-default.cnf
>> 
>> # WCT modifications 2012Jun21 -
>> port		= 3306
>> socket		= /opt/local/var/run/mysql51/mysqld.sock

/opt/local/var/run/mysql51/mysqld.sock is where the mysql51-server port would put its socket and where the mysql51 port's mysql program would look for it, though you can change that by editing /opt/local/etc/mysql51/my.cnf.


So the problem is you are mixing and matching things. You've got the new mysql51-server running, but are trying to talk to it using the old mysql5 port. Decide whether you want to use the old mysql5 ports or the new mysql51 ports.






More information about the macports-dev mailing list