2

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.

  • 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
2

I suspect that you haven't started MySQL server:

ps -ax | grep mysql
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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