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.

2
  • You said that the file mysqld.sock exists. What about its permissions? Commented Sep 10, 2011 at 7:03
  • I ran chmod a=rwx mysqld.sock and it made no difference. Commented Sep 10, 2011 at 9:08

1 Answer 1

2

I suspect that you haven't started MySQL server:

ps -ax | grep mysql 
1
  • 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" Commented Sep 10, 2011 at 5:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.