views:

55

answers:

1

I am not able to start MySQL server on Mac OS X 10.4.11. MySQL was installed using Macports. MySQL was running fine until it suddenly died without any obvious reason.

When running "mysql", I get the error message:

 ERROR 2002 (HY000): Can't connect to local MySQL server through 
 socket '/opt/local/var/run/mysql5/mysqld.sock' (2)

If I try to start MySQL manually, I get the following error message:

 sudo /opt/local/share/mysql5/mysql/mysql.server start
 Starting MySQL/opt/local/share/mysql5/mysql/mysql.server: line
 159: kill: (636) - No such process
 ERROR!

In /etc/mysql/my.cnf I have:

 socket = __PREFIX/var/run/mysqld/mysqld.sock

But the path "opt/local/var/run/mysqld/" does not exist on my system.

I tried to change the socket path to "__PREFIX/var/run/mysql5/ mysqld.sock" (which is where the socket is located). Unfortunately, this did not help either.

Owner and Permissions for /opt/local/var/run/mysql5/ are correctly set.

Any suggestions on how to start MySQL again? Thanks for your advice.

+1  A: 

I use a Mac too and install MySQL from macports. I have experienced the same WTF moments you describe, and I've had to resort to this solution to restart MySQL:

# launchctl unload /Library/LaunchDaemons/org.macports.mysql5.plist
# launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

That seems wrong, too brute force. But I haven't found a better solution yet. I suggest searching ServerFault.com and see if someone else has a better method. Please post here if you do find something.

@lacopo: Why use macports? Because macports is really picky about dependencies. If you use any macports tools that depend on MySQL, it's easier to install MySQL via macports.

Bill Karwin