Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 0 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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