Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to install MySQL on OS X.

First I tried MacPorts. I followed the instructions in step 3 of https://trac.macports.org/wiki/howto/MAMP, but when I ran mysqladmin5 or mysql5 I get:

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

The file mysqld.sock existed.

Then I tried installing using a .dmg from mysql.com. (I ran port uninstall mysql5-server first.) Now, I get:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

How can I fix this? I see that a lot of questions deal with this, but I haven't found a solution that works for me.

share|improve this question
    
You said that the file mysqld.sock exists. What about its permissions? –  Khaled Sep 10 '11 at 7:03
    
I ran chmod a=rwx mysqld.sock and it made no difference. –  ooga Sep 10 '11 at 9:08

1 Answer 1

I suspect that you haven't started MySQL server:

ps -ax | grep mysql
share|improve this answer
    
The output is "404 ?? 0:00.09 /opt/local/bin/daemondo --label=mysql5 --start-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart ; --pid=none" –  ooga Sep 10 '11 at 5:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.