Bug #11380 mysqld will not start-problem with /tmp/mysql.sock
Submitted: 16 Jun 2005 13:07 Modified: 14 Aug 2005 3:01
Reporter: Jeff Jones Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.0.7 OS:Mac OS X (Mac OS 10.3.9)
Assigned to: Lenz Grimmer

[16 Jun 2005 13:07] Jeff Jones
Description:
I installed 5.0.7 yesterday and the StartupItems package. When I restart and run TOP, it does not show the mysqld daemon running. When I attempt to start it by hand in Terminal using "shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start", it pauses as if to start and returns to prompt without error but mysqld is still not running. Of course, when I try to connect I get the "Error:2002 ..../tmp/mysql.sock" error because the server is not running.

I've read the forum posts and others are having the same problem.

Thank you,

Jeff Jones

From my /usr/local/mysql/data/blimpy.local.err file:

050615 20:36:16  mysqld started
050615 20:36:16 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
050615 20:36:16 [ERROR] Can't start server : Bind on unix socket: Permission denied
050615 20:36:16 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
050615 20:36:16 [ERROR] Aborting

050615 20:36:16 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

050615 20:36:16  mysqld ended

050615 20:37:22  mysqld started
050615 20:37:23 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
050615 20:37:23 [ERROR] Can't start server : Bind on unix socket: Permission denied
050615 20:37:23 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
050615 20:37:23 [ERROR] Aborting

050615 20:37:23 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

050615 20:37:23  mysqld ended

050615 20:40:41  mysqld started
050615 20:40:42 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
050615 20:40:43 [ERROR] Can't start server : Bind on unix socket: Permission denied
050615 20:40:43 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
050615 20:40:43 [ERROR] Aborting

050615 20:40:44 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

050615 20:40:44  mysqld ended

From mysqlbug:

Release:       mysql-5.0.7-beta-standard (MySQL Community Edition - Standard (GPL))

>C compiler:    gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1671)
>C++ compiler:  gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1671)
>Environment:
        <machine, os, target, libraries (multiple lines)>
System: Darwin blimpy.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1666)
Compilation info: CC='ccache gcc'  CFLAGS=''  CXX='ccache gcc'  CXXFLAGS=''  LDFLAGS=''  ASFLAGS=''
LIBC:

lrwxr-xr-x  1 root  wheel  15 17 Mar  2004 /usr/lib/libc.dylib -> libSystem.dylib
Configure command: ./configure '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community\
 Edition - Standard (GPL)' '--with-extra-charsets=complex' '--with-server-suffix=-standard' '--enable-thread-safe-client' '--enable-local-infile' '--disable-shared' '\
--with-big-tables' '--with-readline' '--with-archive-storage-engine' '--with-innodb' 'CC=ccache gcc' 'CXX=ccache gcc'

How to repeat:
Install 5.0.7 on Mac OS 10.3.9(not server). Attempt to connect to the database after restarting.

Suggested fix:
I'm not a developer. From my UNIX experience it appears to be a permission problem with mysqld and the directory it accesses but this is just a guess.

Sorry.
[28 Jun 2005 17:11] Ronnie Schwartz
Same problem on my machine.

/tmp/mysql.sock does not exist.

I tried changing the /etc/my.cnf file to /tmp/mysql2.sock and it passes through the log file:

050628 13:06:57  mysqld started
050628 13:06:57 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
050628 13:06:57 [ERROR] Can't start server : Bind on unix socket: Permission denied
050628 13:06:57 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql2.sock ?
050628 13:06:57 [ERROR] Aborting

050628 13:06:57 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

050628 13:06:57  mysqld ended
[28 Jun 2005 17:13] Ronnie Schwartz
Forgot to mention, I am on 10.4.1.
[1 Jul 2005 1:53] [ name withheld ]
I'm having the same problem on both my osx machines:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

one of the machines is  10.3.9 and the other is 10.4.1
[6 Jul 2005 4:45] Jorge del Conde
Thanks for your bug report.  I was able to reproduce this in 10.4.1 darwin
[13 Jul 2005 6:48] oliver charlet
Hi,

I have the same problem using mysql 4.1.12 running on Mac OS X 10.4.1.
Neither the SystemPref application, nor running /Library/StartupItems/MySQLCOM/MySQLCOM, nor running /usr/local/mysql/bin/mysqld_safe will make the server start. 

I tried to remove /tmp/mysql.sock manually, as I thought maybe that would prevent a new server to start, but it had no effect.

:oliver
[27 Jul 2005 18:41] Jim Winstead
This is happening because the pre/post installation scripts in the installer are only running before and after fresh installs, not when installing an upgrade.

Our preinstall and postinstall scripts for the Mac OS X installer should be renamed preflight and postflight so they are run for both fresh installs and upgrades.

To fix an installation done with the broken installer, you just need to do the following:

$ cd /usr/local/mysql
$  ./scripts/mysql_install_db --rpm
$ chown -R mysql data
[11 Aug 2005 18:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/28174
[12 Aug 2005 15:20] Lenz Grimmer
Now pushed - fix will be included in 4.0.26, 4.1.14, and 5.0.12. The Mac OS X installer will now execute the preflight and postflight scripts every time a Mac OS X PGK of MySQL is installed. Previously, these scripts were called "preinstall" and "postinstall", which are only executed during a fresh installation, not on update.
[14 Aug 2005 3:01] Paul Dubois
Noted in 4.0.26, 4.1.14, 5.0.12 changelogs.
[12 May 2006 17:25] Nadorvir
i have FreeBSD 6.1 
Mysql (4.1.19) can't start with same error message.
version 4.1.18 worked normally
[7 Sep 2007 3:50] Helvecio da Silva
I've installed package 5.0.45 and I too am having this /tmp/mysql.sock problem. Any news on that?
[27 Feb 2009 15:06] Rick Saltzman
My solution to the [ERROR] Can't start server : Bind on unix socket: Permission denied problem was to change ownership of the directories:
__PREFIX/var/run/mysqld
__PREFIX/var/db/mysql

sudo chown mysql <each directory>
[12 Apr 2011 0:12] Ajay kumar
test