1

My boss update my computer to Snow Leopard, after the update we had a set back and deleted a few files/folders, since then is just nightmare after another one. I finally getting things back but I'm still having problems with MySQL. This is what I did:

  1. Deleted ALL of mysql files/folders
  2. Download and installed the packages mysql-5.1.45-osx10.6-x86_64.dmg
  3. installed the Startup item and the preferences panel

After the above, I tried to start MySQL from the preferences panel without luck, and running the following command from Terminal

/usr/local/mysql/bin/mysql

I get the following result

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

I looked at some other post for possible solutions, but what they does not exactly fits my problem, so I cannot find a solution.

I'm new to all this and your help will be much appreciated.

Ole Media
  • 121
  • 3

3 Answers3

1

ERROR 2002 is usually caused by mysqld not running. Did you install and start the server? If so, then restart it as the socket may be missing for some reason.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
1

Sometimes the mysql socket file is located at /var/mysql/mysql.sock on OS X. Try:

ln -s /var/mysql/mysql.sock /tmp/mysql.sock
Josh
  • 9,190
  • 28
  • 80
  • 128
1

Here is the solution to my particular problem:

MySQL has a Preferences pane but I think it might not work on Snow Leopard. So the error I was getting is due to the fact the most likely installing just mysql it doesn't start the daemon. To start the deamon, I used launchd plist. If you do a Google search for Snow Leopard, MySQL and launchd, there are a number of articles out there.

A website that I found, had these instructions:

HiveLogic comes to the rescue with a preconfigured plist for launchd. (Or you could just set it up by hand or with Lingon)

Head to your temp directory and do the following. (Any directory will do – just make sure you delete the files afterwards. I have a ~/temp directory for this sort of stuff.)

curl -O http://hivelogic.com/downloads/com.mysql.mysqld.plist
sudo mv com.mysql.mysqld.plist /Library/LaunchDaemons
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist

MySQL should now run on startup. To start it now (so you don’t need to reboot) do the following:

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist

If no errors are reported things are probably working.

Ole Media
  • 121
  • 3