mysql server will not start

Bug #573318 reported by Daniel Rubio Bonilla on 2010-05-01
This bug affects 18 people
Affects Status Importance Assigned to Milestone
MySQL Server
mysql-dfsg-5.1 (Ubuntu)

Bug Description

Binary package hint: mysql-server

Clean installation of Ubuntu Server 10.04 i386.
Install of package mysql-server (5.1.41-3ubuntu12)

When I try:
$ sudo service mysql start
start: Job failed to start

The files are empty:

Chuck Short (zulcss) wrote :

Please attach your /var/log/kern.log and /var/log/daemon.log.


Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Stas Sușcov (sushkov) wrote :

This is what I get in my daemon.log when trying
service mysql start

tags: added: lucid
C de-Avillez (hggdh2) wrote :

Hi Stas,

I am afraid you forgot to attach the logs...

Irene Zürcher (irene-zuercher) wrote :

Tried to start mysql by the following command:

sudo service mysql start

at around 11:56 system time.

Irene Zürcher (irene-zuercher) wrote :

Tried to start mysql by the following command:

sudo service mysql start

at around 11:56 system time.

Irene Zürcher (irene-zuercher) wrote :

Sorry, posted the syslog instead of the deamon.log.

Attached the deamon.log.

Irene Zürcher (irene-zuercher) wrote :

Sorry, posted the syslog instead of the deamon.log.

Attached the deamon.log.

I am having the same issue, daemon.log reports

"May 16 16:58:46 mythbox init: mysql pre-start process (23901) terminated with status 1"

I can start the process manually with sudo -u mysql mysqld


i've the same issue, it's a very bad time for me to have this issue...

daemon.log shows only this :

May 17 19:05:28 sd1 init: mysql pre-start process (4506) terminated with status 1

nothing in kern.log

in safe mode, it works.

It seems that some ubuntu specific init scripts is wrong here...

root@sd1:~# mysqld_safe --user=mysql&
[1] 4693
root@sd1:~# 100517 19:14:21 mysqld_safe Logging to '/var/lib/mysql/'.
100517 19:14:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

root@sd1:~# mysqladmin version
mysqladmin Ver 8.42 Distrib 5.1.41, for debian-linux-gnu on x86_64
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 5.1.41-3ubuntu12
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 7 sec

Threads: 1 Questions: 1 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.142
root@sd1:~# mysqladmin -u root shutdown
100517 19:14:43 mysqld_safe mysqld from pid file /var/lib/mysql/ ended
[1]+ Done mysqld_safe --user=mysql

root@sd1:/etc# ll mysql
total 24
drwxr-xr-x 3 root root 4096 2010-05-17 19:15 .
drwxr-xr-x 111 root root 12288 2010-05-17 19:02 ..
drwxr-xr-x 2 root root 4096 2010-05-17 19:02 conf.d
-rw------- 1 root root 333 2010-05-17 14:20 debian.cnf

no debian.start script, is it normal ?
I've once seen it, but I've remove --purge the package to reinstall it, upon reinstall, the init script that ask for root password was not triggered (ie i didnt have the possiblity to enter a root password)

/etc/mysql/my.cnf is absent and that's whay the pre-init script fails

I've taken a my.cnf.dpkg-dist, put it inside /etc/mysql/my.cnf and mysql was able to start !

/etc/mysql/my.cnf is missing, here is a default ( my.cnf.dpkg-dist) file to put in /etc/mysql

Doesn't seem to fix the issue here (mine was missing also)

@thecapsaicinkid is your file readable ?

because if you look at the pre-start script it makes the following check :

pre-start script
    #Sanity checks
    [ -r $HOME/my.cnf ]
    [ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld
    LC_ALL=C BLOCKSIZE= df --portability /var/lib/mysql/. | tail -n 1 | awk '{ exit ($4<4096) }'
end script

What you can do is :

su - mysql
export HOME=/etc/mysql

and try to run the command and check which one return false ( something != 0)

$[ -r $HOME/my.cnf ]
$echo $?

On my second server, the fact that I put my.cnf before installing the package allow me to install normally mysql-server

It's working now, I had a typo in the filename! Cheers

Chuck Short (zulcss) wrote :

Thanks closing then.


Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Invalid
neilyalowitz (neilyalowitz) wrote :

Hey, not sure why this issue is closed... I don't recall copying a "my.cnf" by hand during previous MySQL installations, why is it required now?

I had MySQL installed via the package at one point, performed a Complete Remove, and then later performed Install again (all via Synaptic). I had the same issue with the MySQL service failing to start until I manually copied the "my.cnf" into /etc/mysql/

Failing to properly install after complete removal/re-installation seems like a bug to me. Am I missing something?

my.cnf is part of the mysql-common package, not the server one. Not sure how I ended up losing mine.

Mithun J. Shitole (mithunit) wrote :

I am facing exactly the same problem. I tried clean reinstalling system, but problem resurfaced again. I am using linode, installed Ubuntu 10.04 server ( 32 bit ).
I checked the my.cnf file, its there and readable. I am out of clues now. :(

Alfonso Izquierdo (sitonico) wrote :

I'm with the same problem in Ubuntu 10.04. my.cnf file is okay also, and I also reinstalled with no success...

Alfred Maghi (alfred-maghi) wrote :

I have the same problem in Natty Ubuntu 11.04.

$ sudo service mysql start
start: Job failed to start

/etc/mysql/my.cnf file was missing, I created it, it is readable ("-rw-r--r-- 1 root root 3770 /etc/mysql/my.cnf") but now "sudo service mysql start" does nothing but wait. No error message, nothing happens:

$ sudo service mysql status
mysql start/running

mysql service doesn't start but I can run mysqld_safe.
110513 02:05:36 mysqld_safe Logging to syslog.
110513 02:05:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110513 02:05:36 mysqld_safe mysqld from pid file /var/lib/mysql/ ended

I am not sure this a bug.

J.A. de Moura Neto (jamoura) wrote :


cp /var/lib/mysql /home/backup-mysql -Rfp
apt-get remove mysql-common libmariadbclient16 libmysqlclient16
apt-get install mysql-server mysql-common mysql-client php5-mysql

For me, it's Ok, now.

Troex Nevelin (troex) wrote :

Strange but in case the problem was missing /etc/apparmor.d/tunables/home which also caused a problem starting cups

GonzO (gonzo) wrote :

#24 worked for me, although I didn't have libmariadbclient16. Thank you, J.A.!

Paul Kendall (paul-kcbbs) wrote :

The problem for me was that the file /etc/apparmor.d/local/usr.sbin.mysqld did not exist after the upgrade. I manually copied one from one of the empty ones (i.e. only had header comment) and then everything was good to go.

Géza Búza (medve) wrote :

I got the same problem with 12.04 and mysql-server 5.5. Paul's method did the trick.

ski (skibrianski) wrote :

I also had this problem with ubuntu 12.04 and mysql-server 5.5, and Paul's fix also worked for me. Seems like a pretty silly reason for mysql to crash.

Stefano Bagnatica (thepisu) wrote :

After upgrading Xubuntu 11.10 to 12.04, I had the same problem of #27, solved creating the empty /etc/apparmor.d/local/usr.sbin.mysqld .

Solution #30 works in Precise.

Arthur (iegik) wrote :

Failed after daily update on 14.05.2012
Solution #30 works in Precise:
     sudo touch /etc/apparmor.d/local/usr.sbin.mysqld

[ 24.543051] init: mysql pre-start process (1164) terminated with status 1
[ 31.284812] vboxpci: IOMMU not found (not registered)
[ 60.021412] init: plymouth-stop pre-start process (1837) terminated with status 1
[ 507.551994] init: mysql pre-start process (2680) terminated with status 1
[ 847.524494] init: mysql pre-start process (3076) terminated with status 1

/var/log/mysql/error.log is empty since 28.04.2012

Tom (tparle) wrote :

Solution #30 works in Precise also for me, thank for work-around !

hegemon8 (pantokrata2) wrote :

I've fixed this issue for my case. I have kubuntu 12.04 (64-bit) and tried to install airtime. And it was failing. As I'm newbie I've spent few hours searching for a cause. in log file i found this:

createdb: database creation failed: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

HINT: Use the same encoding as in the template database, or use template0 as template.

Next two hours looking for a right solution (of many I've found), and thanks to this:
Ive entered in terminal:
sudo pg_dropcluster --stop 9.1 main
sudo pg_createcluster --locale=en_US.utf8 --start 9.1 main

And works fine 4 me :)

AJenbo (ajenbo) wrote :

I upgraded 11.10 to 12.04 and then purged removed packages. This left me with out /etc/apparmor.d/local/usr.sbin.mysqld (as mysql 5.1 was purged as it was replaced by mysql 5.5). Copied the file from a different machine made everything work again. Here is the original content:

# Site-specific additions and overrides for usr.sbin.mysqld.
# For more details, please see /etc/apparmor.d/local/README.

(basically an empty file)

ganassa (ganassa) wrote :

Ubuntu 12.04, same problem, solved as suggested in #24, #35 etc. (thank you)

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

Other bug subscribers