2

This is an issue that is really driving me nuts today:

Basically, I compiled MySQL from source (MySQL 5.1.14 on Ubuntu 9.04 on an ARM machine), and here is what happened when I tried to run it:

/etc/init.d/mysql start
Starting MySQL.. * Manager of pid-file quit without updating file.

Digging into the error log, here is what I see:

110826 18:00:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110826 18:00:22 [ERROR] Can't start server : Bind on unix socket: Permission denied
110826 18:00:22 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110826 18:00:22 [ERROR] Aborting

110826 18:00:22 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

110826 18:00:22 mysqld_safe mysqld from pid file /usr/local/mysql/var/Serv.pid ended

So here is what I tried to do:

touch mysql.sock
chown mysql:mysql mysql.sock
chmod 1777 mysql.sock

And everything seems to be fine:

ls -la | grep mysql.sock
-rwxrwxrwt  1 mysql mysql        0 2011-08-26 18:02 mysql.sock

But guess what, every time I tried to restart mySQL, the same error happened and it seems that for some reason, the sock file was gone.

I was running the whole process as root, so permission should not be a problem.

Any suggestion? Thanks!

zhuanyi
  • 191
  • 3
  • 11

3 Answers3

0

You really should not create this file manually, this is not an ordinary file, this is a named socket and it should be listed in ls output something like srwxrwxrwx 1 mysql mysql 0 Aug 20 23:49 mysql.sock=. Are you sure another mysqld is not started on the same socket?

Alex
  • 7,939
  • 6
  • 38
  • 52
0

Is Ubuntu set up to use a security framework such as SELinux, SMACK or AppArmor that would need to be modified to allow your custom mysql instance to run? Are the database files that mysql needs owned by the mysql user as mysql does give up root privileges when it runs?

As a side note your attempt to create a socket file is incorrect, you have created a regular file not a socket, you need to use mksock to create a socket file in the filesystem.

mtinberg
  • 1,833
  • 11
  • 9
  • I have no AppArmor nor Selinux installed, tried to run with mysql user to start the instance with no luck as well... – zhuanyi Aug 27 '11 at 04:24
  • And do you know how to run mksock? There is no command in Ubuntu 9.04 it seems... – zhuanyi Aug 27 '11 at 04:25
0

chmod 1777 /tmp and try again.

quanta
  • 51,413
  • 19
  • 159
  • 217