Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

Followed http://hivelogic.com/articles/compiling-mysql-on-snow-leopard to the T.

Log:

110313 20:48:37 mysqld_safe mysqld from pid file /usr/local/mysql/var/moneymake-computer.local.pid ended 110313 20:48:46 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var 110313 20:48:46 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/var/ is case insensitive 110313 20:48:46 InnoDB: Started; log sequence number 0 44233 110313 20:48:46 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use 110313 20:48:46 [ERROR] Do you already have another mysqld server running on port: 3306 ? 110313 20:48:46 [ERROR] Aborting

110313 20:48:46 InnoDB: Starting shutdown... 110313 20:48:47 InnoDB: Shutdown completed; log sequence number 0 44233 110313 20:48:47 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

110313 20:48:47 mysqld_safe mysqld from pid file /usr/local/mysql/var/moneymake-computer.local.pid ended 110313 20:48:56 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var 110313 20:48:56 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/var/ is case insensitive 110313 20:48:56 InnoDB: Started; log sequence number 0 44233 110313 20:48:56 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use 110313 20:48:56 [ERROR] Do you already have another mysqld server running on port: 3306 ? 110313 20:48:56 [ERROR] Aborting

110313 20:48:56 InnoDB: Starting shutdown... 110313 20:48:58 InnoDB: Shutdown completed; log sequence number 0 44233 110313 20:48:58 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

110313 20:48:58 mysqld_safe mysqld from pid file /usr/local/mysql/var/moneymake-computer.local.pid ended

CONSOLE.app Shows tmp/mysql.sock Permission denied and that its starting and stopping the server every 10 seconds, which it looks like tmp/mysql.sock is being created every 10 seconds. Maybe that file is locked?

24 hours in so far....

share|improve this question

migrated from stackoverflow.com Mar 14 '11 at 9:17

This question came from our site for professional and enthusiast programmers.

1 Answer 1

There are many reasons this could be the case. Can you verify that MySQL is actually running? Even if it is, you might check the logs to see if it had any problems starting up or opening the socket.

share|improve this answer
    
You might check the Permissions on /tmp, I think it's owned by root:wheel by default, so mysql (running as the mysql user according to the launchd plist) might not have permissions to create the socket. You might also have multiple mysql processes running (or at least something else bound to port 3306). Try killing any mysqld processes in activity monitor before relaunching. –  thatothermitch Mar 14 '11 at 3:35
    
Did it but nothing helped. –  jgervin Mar 14 '11 at 4:24
    
if all else fails, you might try removing the launchd plist you added and then reinstall with macports -- that's typically how I install such dependencies on my OSX systems –  thatothermitch Mar 14 '11 at 4:47
    
Tried install everything with macports and same thing mysql is starting and stopping every 10 seconds. It shows in the console that access to tmp/mysql.sock is Permission denied. I tried to run the chown to make tmp read+write but not sure if mysql.sock is read write as, not sure you can since it created everytime mysql starts? –  jgervin Mar 14 '11 at 18:35

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.