Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed MySQL Server and Startup tools from the DMG at the MySQL site on an OSX 10.6.6. I restarted the computer, but it seems it can't connect to its socket.

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

I try starting the server

$ sudo /usr/local/mysql/bin/mysqld_safe &
[2] 917

But I still get

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

I can't seem to find the socket file

$ ls /tmp/mysql*
ls: /tmp/mysql*: No such file or directory
$ ls /var/lib/mysql*
ls: /var/lib/mysql*: No such file or directory
share|improve this question
up vote 1 down vote accepted

You must start server and add the root user.

Starting the server:

sudo /usr/local/mysql/support-files/mysql.server start , or

sudo /usr/local/mysql/bin/mysqld_safe --user=mysql & , or

sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

Add root user:

/usr/local/mysql/bin/mysqladmin -u root password your_password

share|improve this answer
    
sudo /usr/local/mysql/support-files/mysql.server start is what works for me – highBandWidth Aug 17 '12 at 21:34
    
ERROR! The server quit without updating PID file .... ? – Pesulap Feb 17 '15 at 9:27

Just start your Mysql-Server like this:

service mysql start

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .