Mysqld does not start: Bind on unix socket: Permission denied
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.1 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I updated to oneiric and mysqld does not start. It seems it can't create the socket /var/run/
What the log /var/log/
===
11017 9:44:12 [Note] Plugin 'FEDERATED' is disabled.
111017 9:44:12 InnoDB: Initializing buffer pool, size = 8.0M
111017 9:44:12 InnoDB: Completed initialization of buffer pool
111017 9:44:12 InnoDB: Started; log sequence number 0 363147242
111017 9:44:12 [ERROR] Can't start server : Bind on unix socket: Permission denied
111017 9:44:12 [ERROR] Do you already have another mysqld server running on socket: /var/run/
111017 9:44:12 [ERROR] Aborting
===
But, I have the appropiate permisions:
===
$ ls -la /var/run/mysqld
total 0
drwxr-xr-x 2 mysql root 40 2011-10-17 09:29 .
drwxr-xr-x 31 root root 1040 2011-10-17 09:17 ..
===
And I checked mysqld runs as the appropiate user:
===
mysql 12938 1 2 09:33 ? 00:00:00 /usr/sbin/mysqld
===
Trying mysql_safe:
===
$ sudo mysqld_safe
[sudo] password for manolinux:
111017 09:49:26 mysqld_safe Logging to syslog.
111017 09:49:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
111017 09:49:32 mysqld_safe mysqld from pid file /var/lib/
===
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: mysql-server-5.1 5.1.58-1ubuntu1
ProcVersionSign
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Mon Oct 17 09:38:02 2011
ProcEnviron:
LANGUAGE=
PATH=(custom, user)
LANG=es_ES.UTF-8
LC_MESSAGES=
SHELL=/bin/bash
SourcePackage: mysql-5.1
UpgradeStatus: Upgraded to oneiric on 2011-10-14 (2 days ago)
mtime.conffile.
I found the problem.
It was on /etc/apparmor. d/usr.sbin. mysqld , which clever unbuntu-bug found it was modified.
During upgrade, I was asked whether to substitute this file with a new version, but since I needed some of the current configuration and since I thought the changes where cosmetic (but they were not!), I choosed to keep my file.
I compared my file with the base version and applied the changes myself, and it worked. The changes were:
=== d/usr.sbin. mysqld. bak /etc/apparmor. d/usr.sbin. mysqld d/usr.sbin. mysqld. bak 2011-10-17 10:02:03.000000000 +0200 d/usr.sbin. mysqld 2011-10-17 10:02:33.000000000 +0200 lib/mysql/ ** rwk, mysqld/ mysqld. pid w, mysqld/ mysqld. sock w, }run/mysqld/ mysqld. pid w, }run/mysqld/ mysqld. sock w,
diff -u /etc/apparmor.
--- /etc/apparmor.
+++ /etc/apparmor.
@@ -33,8 +33,8 @@
/var/
/var/log/mysql/ r,
/var/log/mysql/* rw,
- /var/run/
- /var/run/
+ /{,var/
+ /{,var/
/sys/ devices/ system/ cpu/ r, manolinux/ .opentpv/ ** rw,
/home/
===
Sorry to disturb you, Ubuntu develpers, but I hope at least this report helps other people with similar problems.
Thanks.