mysql51-server socket

Craig Treleaven ctreleaven at cogeco.ca
Thu Jun 21 08:18:41 PDT 2012


At 7:35 AM -0700 6/21/12, Bradley Giesbrecht wrote:
>On Jun 21, 2012, at 7:15 AM, 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
>>>
>>>  $ 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
>>
>>  No success.  Should I file a ticket?  Is there a workaround in the meantime?
>
>The mysql5 port has not yet been replaced_by mysql55. The mysql51 
>port was created for those that are not ready to upgrade to mysql55 
>when mysql5 is eventually replaced_by mysql55.
>
>
>If you want to use mysql51 then you will want to use the mysql51 executables:
>$ port contents mysql51 | grep /bin/
>
>
>There is also the mysql_select port which will put simlink 
>executables into your path:
>$ sudo port select mysql mysql51
>$ which mysql
>/opt/local/bin/mysql
>$ ls -la $(which mysql)
>lrwxr-xr-x  1 root  admin  32 Jun 21 07:32 /opt/local/bin/mysql -> 
>/opt/local/lib/mysql51/bin/mysql
>

Hi Bradley:

Sorry, I only have version 5.1 installed:
$ which mysql5
/opt/local/bin/mysql5
$ mysql5 --version
mysql5  Ver 14.14 Distrib 5.1.62, for apple-darwin11.4.0 (i386) using 
readline 6.2
$ 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)

I think the problem is that mysql is looking for the socket at -
/opt/local/var/run/mysql5/mysqld.sock

but it is actually at -
/opt/local/var/run/mysql51/mysqld.sock

ie "5" v. "51", no?

BTW, it is a bit awkward for me to test--I have to reboot into Lion 
and then back to SL for email, et al.  I overlooked your 
recommendation to run 'sudo port select mysql mysql51'.  I'll try 
that in a bit.

Craig
-- 
--
Craig Treleaven, CA -- Clearview Consulting
(905) 829-2054  ctreleaven at cogeco.ca


More information about the macports-dev mailing list