2

I have successfully installed MySQL using Homebrew. However, whenever I type the command mysql I receive this error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I suspect this is a permission problem, as I have confirmed my system is looking for MySQL in the right location. However, I a novice with Unix(OSX) and don't know how to rectify the problem.

I am using OSX 10.7 (Lion)

which mysql produces /usr/local/bin/mysql

skline
  • 605
  • 1
  • 6
  • 8
  • 1
    I had the same problem and solved it by reading this; http://serverfault.com/questions/178088/mysql-problems-after-mac-os-x-software-update – Burak Erdem Aug 29 '11 at 21:32
  • Tryout this answer [http://stackoverflow.com/a/8460131/440967](http://stackoverflow.com/a/8460131/440967) i ran to the same problem – lmmendes Dec 10 '11 at 21:48

1 Answers1

1

When you type 'mysql' you are running the MySQL client. The client needs to communicate with the server. If you simply run 'mysql' without any argument it assumes you are trying to connect to a mysql server that is located on 'localhost' using the user name as the user you are running the command as and without a password.

From the error it seems your server is not running yet. Start it by typing: mysql.server start

sn00k4h
  • 443
  • 4
  • 10