mysql-server won't start after update

Bug #582970 reported by Robert
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.1 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I installed the update (5.1.41-3ubuntu12.1) today. dpkg crashed. I reran dpkg-reconfigure mysql-server to fix the broken package, but the daemon will not start.

status mysql reports "mysql start/post-start, (post-start) process 1194" but there is nothing in /var/run/mysqld.

I assume Bug #551130 is related. But the important issue is that the server is just not starting.

When I "su mysql" and run mysqld I get the following:

100519 18:35:25 [Warning] Can't create test file /srv/var/lib/mysql/dwaible.lower-test
100519 18:35:25 [Warning] Can't create test file /srv/var/lib/mysql/dwaible.lower-test
100519 18:35:25 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
100519 18:35:25 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
100519 18:35:25 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

Permissions in that directory are file. I can create test files as user "mysql" there.

If I run mysql_upgrade, I get errors:

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: mysql-server 5.1.41-3ubuntu12.1
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic x86_64
Architecture: amd64
Date: Wed May 19 18:19:37 2010
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['pandaw', 'debian-5.1.flag', 'ibdata1', 'ib_logfile1', 'mysql_upgrade_info', 'dwaible.err', 'ib_logfile0', 'mysql']
PackageArchitecture: all
ProcEnviron:
 LANG=en_GB.utf8
 SHELL=/bin/bash
SourcePackage: mysql-dfsg-5.1

Revision history for this message
Robert (robrwo) wrote :
Revision history for this message
Robert (robrwo) wrote :

/var/log/messages has entries such as:

May 19 18:53:16 dwaible kernel: [ 111.737472] type=1505 audit(1274291596.871:17): operation="profile_replace" pid=2491 name="/usr/sbin/mysqld"
May 19 18:53:16 dwaible kernel: [ 111.824343] type=1503 audit(1274291596.961:18): operation="mknod" pid=2495 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=0 ouid=0 name="/srv/var/lib/mysql/dwaible.lower-test"
May 19 18:53:16 dwaible kernel: [ 111.824471] type=1503 audit(1274291596.961:19): operation="mknod" pid=2495 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=0 ouid=0 name="/srv/var/lib/mysql/dwaible.lower-test"
May 19 18:53:16 dwaible kernel: [ 111.840412] type=1503 audit(1274291596.981:20): operation="mknod" pid=2495 parent=1 profile="/usr/sbin/mysqld" requested_mask="c::" denied_mask="c::" fsuid=123 ouid=123 name="/srv/var/log/mysql/error.log"
May 19 18:53:16 dwaible kernel: [ 111.850493] type=1503 audit(1274291596.991:21): operation="open" pid=2495 parent=1 profile="/usr/sbin/mysqld" requested_mask="r::" denied_mask="r::" fsuid=123 ouid=123 name="/srv/var/lib/mysql/mysql/plugin.frm"

Ok. It's not being given access, even though the permissions on the files are fine. So what's blocking it?

Revision history for this message
Robert (robrwo) wrote :

I've found the cause of the problem. It was due to mysql not having permissions to the appropriate directories in AppArmor. Changing them fixed it.

Question: why did MySQL run before the update without the permissions?!? (Another bug report, I think.)

Changed in mysql-dfsg-5.1 (Ubuntu):
status: New → Fix Released
Revision history for this message
Serobur (serobur) wrote :

Can you please describe in details how to fix it?
I'm not sure when fix will be in updates and need mysql to be running now.

Revision history for this message
Robert (robrwo) wrote : Re: [Bug 582970] Re: mysql-server won't start after update

On 19/05/10 21:34 Serobur wrote:
> Can you please describe in details how to fix it?
> I'm not sure when fix will be in updates and need mysql to be running now.
>

If MySQL won't start because of permissions problems (try running

   sudo -u mysql mysqld

or check /var/log/messages and /var/log/mysql/error.log, then this is the
same problem that I am having. (Especially if you have changed the location
of some files from the defaults.)

Check that data and log file directories have the correct rw permissions.

Then check /etc/apparmor.d/usr.sbin.mysqld permissions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.