[MySQL] Install difficulties : Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock'

sourceforge.rocks at xemaps.com sourceforge.rocks at xemaps.com
Mon Mar 31 03:45:18 PDT 2008


I've installed and reinstalled MySQL with the following command line:
     $ sudo port install mysql5 +server

Initially, I had trouble creating the initial mysql database because  
the /opt/local/temp directory did not exist (and therefore the /opt/ 
local/temp/mysql5 directory did not exist).

Creating these two directories, and making the mysql user the owner  
of /opt/local/temp/mysql5 allowed me to build the initial database,  
but sadly it had no data in any of the non-index tables.

I went ahead and unistalled mysql5 and reinstalled it, and now I get  
the following when I try to change the root password:
     $ mysqladmin -u root password 'newpass'
     mysqladmin: connect to server at 'localhost' failed
     error: 'Can't connect to local MySQL server through socket '/opt/ 
local/var/run/mysql5/mysqld.sock' (2)'
     Check that mysqld is running and that the socket: '/opt/local/ 
var/run/mysql5/mysqld.sock' exists!

I verified that mysqld is running through the Activity Monitor.

Sure enough, /opt/local/var/run/mysql5/mysqld.sock does not exist.   
In fact, mysqld.sock does not exist anywhere on my hard drive, a fact  
which I determined by:
     $ sudo find / -name "*.sock"

Elsewhere, I found an instruction to
     $ touch opt/local/var/run/mysql5/mysqld.sock

This command creates an empty file of the correct name; however, when  
I tried to change the root password, I got:
     $ mysqladmin -u root password 'newpass'
     mysqladmin: connect to server at 'localhost' failed
     error: 'Can't connect to local MySQL server through socket '/opt/ 
local/var/run/mysql5/mysqld.sock' (38)'
     Check that mysqld is running and that the socket: '/opt/local/ 
var/run/mysql5/mysqld.sock' exists!

Note that only the error number changed.

When I stopped and restarted mysql5:
     $ sudo launchctl unload /Library/LaunchDaemons/ 
org.macports.mysql5.plist
     $ sudo launchctl load -w /Library/LaunchDaemons/ 
org.macports.mysql5.plist
I found that the mysqld.sock was deleted from opt/local/var/run/mysql5/

Does anyone have any ideas about what I'm supposed to do to get a  
properly functioning MySQL5 installation?

Environment:
     MacPorts version 1.600.  I've done a selfupdate before  
attempting to install MySQL5
     Power Mac G4
     Mac OS X 10.4.11

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-users/attachments/20080331/6cc41458/attachment.html


More information about the macports-users mailing list