mysql server will not start

Bug #573318 reported by Daniel Rubio Bonilla
82
This bug affects 18 people
Affects Status Importance Assigned to Milestone
MySQL Server
New
Undecided
Unassigned
mysql-dfsg-5.1 (Ubuntu)
Low
Unassigned

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:
/var/log/mysql.err
/var/log/mysql.log

Revision history for this message
Daniel Rubio Bonilla (danielrubiob-gmail) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

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

chuck

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

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

tags: added: lucid
Revision history for this message
C de-Avillez (hggdh2) wrote :

Hi Stas,

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

Revision history for this message
Irene Zürcher (irene-zuercher) wrote :

Tried to start mysql by the following command:

sudo service mysql start

at around 11:56 system time.

Revision history for this message
Irene Zürcher (irene-zuercher) wrote :

Tried to start mysql by the following command:

sudo service mysql start

at around 11:56 system time.

Revision history for this message
Irene Zürcher (irene-zuercher) wrote :

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

Attached the deamon.log.

Revision history for this message
Irene Zürcher (irene-zuercher) wrote :

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

Attached the deamon.log.

Revision history for this message
thecapsaicinkid (thecapsaicinkid) wrote :

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

Revision history for this message
Manson Thomas (dev-mansonthomas) wrote :

Hi,

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/sd1.123monsite.com.err'.
100517 19:14:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

root@sd1:~#
root@sd1:~#
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/sd1.123monsite.com.pid ended
[1]+ Done mysqld_safe --user=mysql
root@sd1:~#

Revision history for this message
Manson Thomas (dev-mansonthomas) wrote :

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)

Revision history for this message
Manson Thomas (dev-mansonthomas) wrote :

Lol...
/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 !

Revision history for this message
Manson Thomas (dev-mansonthomas) wrote :

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

Revision history for this message
thecapsaicinkid (thecapsaicinkid) wrote :

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

Revision history for this message
Manson Thomas (dev-mansonthomas) wrote :

@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)

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

Revision history for this message
Manson Thomas (dev-mansonthomas) wrote :

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

Revision history for this message
thecapsaicinkid (thecapsaicinkid) wrote :

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

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks closing then.

chuck

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
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?

Revision history for this message
thecapsaicinkid (thecapsaicinkid) wrote :

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

Revision history for this message
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. :(

Revision history for this message
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...

Revision history for this message
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/meuh-desktop.pid ended

I am not sure this a bug.

Revision history for this message
J.A. de Moura Neto (jamoura) wrote :

See: http://kb.askmonty.org/en/error-symbol-not-defined

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.

Revision history for this message
Troex Nevelin (troex) wrote :

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

Revision history for this message
GonzO (gonzo) wrote :

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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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 .

Revision history for this message
Rafael Jesus Alcantara Perez (rafa-dedaloingenieros) wrote :

Solution #30 works in Precise.

Revision history for this message
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

dmesg:
[ 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

Revision history for this message
Tom (tparle) wrote :

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

Revision history for this message
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:

http://askubuntu.com/questions/20880/how-do-i-create-a-unicode-databases-in-postgresql-8-4
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 :)

Revision history for this message
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)

Revision history for this message
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