[MySQL] Install difficulties : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Chris Pickel sfiera at macports.org
Sun Jun 24 20:12:24 PDT 2007


The two files which you need be most concerned about are:

1. /opt/local/etc/my.cnf

This file is not provided by default by mysql5. Have a look at the  
sample my.cnf files in /opt/local/share/mysql5/mysql/ and pick one  
according to your liking (mine, for example, is my-small.cnf with  
"#skip-networking" uncommented).

In mine, I have "socket = /opt/local/var/run/mysql5/mysqld.sock" in  
both the [client] and [mysqld] sections, which is, as Paul said, the  
standard MacPorts socket location.

2. /opt/local/etc/php.ini

Here, I have "mysql.default_socket =" in the [MySQL] section and  
"mysqli.default_socket =" in the [mysqli] section. An empty value  
means that it will check my.cnf's [client] section.

As for the difference in the directories, the logic on the mysql  
developers' part is that the more-standard lib, bin, etc. aren't  
theirs to mess around with, but rather the package managers. The  
logic on our part is, well, we are the package managers :)

What are your permissions on /opt/local/var/run/mysql5 ? On my  
system, this directory is 755 mysql:mysql, since that's where the  
socket resides.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.macosforge.org/pipermail/macports-users/attachments/20070624/6ac37f54/PGP.bin

More information about the macports-users mailing list