mysql.service fail to start after upgrade to mysql-server.5.6

Bug #1435709 reported by Luca D'Isanto
44
This bug affects 10 people
Affects Status Importance Assigned to Milestone
mysql-5.6 (Ubuntu)
Incomplete
High
Lars Tangvald

Bug Description

After upgrade to mysql-server-5.6 mysql.service fail to start (after reboot).
Here the systemctl status mysql.service:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) since mar 2015-03-24 08:41:00 CET; 25s ago
  Process: 951 ExecStart=/usr/bin/mysqld_safe (code=exited, status=0/SUCCESS)
  Process: 943 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 951 (code=exited, status=0/SUCCESS); : 952 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           └─control
             ├─ 952 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─2601 sleep 1

mar 24 08:41:00 luca-k53sd systemd[1]: Starting MySQL Community Server...
mar 24 08:41:00 luca-k53sd mysqld_safe[951]: 150324 08:41:00 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-err...e effect.
mar 24 08:41:00 luca-k53sd mysqld_safe[951]: 150324 08:41:00 mysqld_safe Logging to '/var/log/mysql/error.log'.
mar 24 08:41:00 luca-k53sd mysqld_safe[951]: mkdir: impossibile creare la directory "/var/run/mysqld": Permesso negato
mar 24 08:41:00 luca-k53sd mysqld_safe[951]: chown: impossibile accedere a "/var/run/mysqld": File o directory non esistente
mar 24 08:41:00 luca-k53sd mysqld_safe[951]: chmod: impossibile accedere a "/var/run/mysqld": File o directory non esistente
mar 24 08:41:00 luca-k53sd mysqld_safe[951]: 150324 08:41:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Hint: Some lines were ellipsized, use -l to show in full.

Revision history for this message
Luca D'Isanto (lukadisanto) wrote :
description: updated
tags: added: mysql mysql-server systemd
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mysql-5.6 (Ubuntu):
status: New → Confirmed
Revision history for this message
Robie Basak (racb) wrote :

I don't see a version number stated anywhere in your bug report, but I presume you were using 5.6.23-1~exp1~ubuntu3. Presumed fixed in bug 1421303 (5.6.23-1~exp1~ubuntu4). Please comment if this is incorrect.

Revision history for this message
Robie Basak (racb) wrote :

Oh, I've found it here.

Changed in mysql-5.6 (Ubuntu):
importance: Undecided → High
Revision history for this message
Thomas Karl Pietrowski (thopiekar) wrote :

Also affects me. It seems that a file, containing

'''
d /var/run/mysqld 0755 mysql mysql -
'''

is missing in /etc/tmpfiles.d.

See: https://bugzilla.redhat.com/show_bug.cgi?id=894750

Revision history for this message
Luis Mondesi (lemsx1) wrote :

Any workarounds for this?

Revision history for this message
Luis Mondesi (lemsx1) wrote :

Ok, I made it work. From /var/log/mysql/error.log:

2015-04-08 11:37:13 1441 [ERROR] /usr/sbin/mysqld: unknown variable 'log_slow_queries=/var/log/mysql/mysql-slow.log'
2015-04-08 11:37:13 1441 [ERROR] Aborting

2015-04-08 11:37:13 1441 [Note] Binlog end

After commenting out this line, it works:

$> cat /etc/mysql/my.cnf|grep log_slow
#log_slow_queries = /var/log/mysql/mysql-slow.log

Revision history for this message
Luis Mondesi (lemsx1) wrote :

The new options are:

$> cat /etc/mysql/my.cnf|grep slow
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log

Revision history for this message
Luis Mondesi (lemsx1) wrote :

Also, note that I had to add "return 0" to the "pinger()" function:

/usr/share/mysql/mysql-systemd-start

Maybe this function should be written in a way that it provides feedback:

pinger () {
  while /bin/true ; do
    sleep 1
    mysqladmin ping >/dev/null 2>&1 && break
    logger -p daemon.info "$0 sleeping for 1 second..."
  done
}

Revision history for this message
Elias Probst (eliasp) wrote :

Would it probably make sense to backport the systemd-related improvements [1] from 5.7 to 5.6. Although they're not perfect yet, they're a huge improvement compared to the current hacks required to make mysqld behave more or less sane in systemd environments.

[1] http://mysqlserverteam.com/mysql-5-7-native-systemd-support/

Revision history for this message
Han Zhao (windzhaohan) wrote :

Same problem for me too.

A workaround for me is:

sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/

Source from https://wiki.archlinux.org/index.php/MySQL#Installation

Robie Basak (racb)
Changed in mysql-5.6 (Ubuntu):
assignee: nobody → Lars Tangvald (lars-tangvald)
Changed in mysql-5.6 (Ubuntu):
status: Confirmed → Incomplete
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.