Mysql dead after update

Bug #316974 reported by Arenlor
114
This bug affects 10 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Ubuntu)
Fix Released
High
Mathias Gug
mysql-dfsg-5.1 (Ubuntu)
Fix Released
High
komena

Bug Description

1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up mysql-server-5.1 (5.1.30-2ubuntu2) ...
 * Stopping MySQL database server mysqld [ OK ]
 * Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
Architecture: amd64
DistroRelease: Ubuntu 9.04
ErrorMessage: subprocess post-installation script returned error exit status 1
Package: mysql-server-5.1 5.1.30-2ubuntu2
SourcePackage: mysql-dfsg-5.1
Title: package mysql-server-5.1 5.1.30-2ubuntu2 failed to install/upgrade: subprocess post-installation script returned error exit status 1
Uname: Linux 2.6.28-4-generic x86_64

Revision history for this message
Arenlor (arenlor) wrote :
Revision history for this message
Niall Creech (sevenmachines-deactivatedaccount) wrote :

Seems to fail due to lack of '/var/run/mysqld/mysqld.sock'. creating this file doesnt help as it is removed somewhere as part of the init startup

Jan 14 12:38:50 crystaltree /etc/init.d/mysql[12424]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jan 14 12:38:50 crystaltree /etc/init.d/mysql[12424]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jan 14 12:38:50 crystaltree /etc/init.d/mysql[12424]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jan 14 12:38:50 crystaltree /etc/init.d/mysql[12424]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jan 14 12:38:50 crystaltree /etc/init.d/mysql[12424]:

Changed in mysql-dfsg-5.1:
status: New → Confirmed
Revision history for this message
Niall Creech (sevenmachines-deactivatedaccount) wrote :

problem for me seems to lie in mysql_upgrade, ie.

# less /var/lib/mysql/crystaltree.err

090114 15:19:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
090114 15:19:39 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090114 15:19:39 InnoDB: Started; log sequence number 0 46409
090114 15:19:39 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
090114 15:19:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

but cant successfully run upgrade since cant start mysql server

# mysql_upgrade

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck'...
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

Revision history for this message
Arenlor (arenlor) wrote :

Even after update to ubuntu3 it still doesn't work.

Revision history for this message
jyio (inportb) wrote :

Aww darn... I have run into this issue as well on the Jaunty Jackalope. I'll post if I find anything useful in the future.

Revision history for this message
Arenlor (arenlor) wrote :

Can we get someone to at least set the importance, as MySQL does not work, so I'd guess it'd be a blocking level bug?

Revision history for this message
Niels Egberts (nielsegberts) wrote :

Agreed, amarok depends on mysql so that one also does not want to work.

Revision history for this message
jyio (inportb) wrote :

Ah, right. I guess I'll try to get Amarok to use SQLite in the interim, but I heard it's slow...

Revision history for this message
Mathias Gug (mathiaz) wrote :

Dinxter: did you upgrade from mysql-dfsg-5.0?

Others: you're probably running into the issue reported in bug 316849.

Changed in mysql-dfsg-5.1:
status: Confirmed → Incomplete
Revision history for this message
Niall Creech (sevenmachines-deactivatedaccount) wrote :

i didnt have 5.0 installed but had tables left over from that version when installing 5.1. i'm not sure what 5.0 version the tables were from though, i think it was probably the one on intrepid release. when 5.1 didnt complete postinst properly i tried purging 5.1, installing jaunty's 5.0 and upgrading to 5.1 but this didnt help. my post above was from this stage. i ended up purging the old tables and reinstalling 5.1 with no problems. i havent managed to recreate the problem installing 5.0 from jaunty, creating a few tables and upgrading to 5.1

Revision history for this message
Niall Creech (sevenmachines-deactivatedaccount) wrote :

cant seem to recreate the problem by upgrading from intrepid mysql-server-5.0_5.0.67-0ubuntu6_amd64 to jaunty mysql-server-5.1 5.1.30-2ubuntu3 either. wish i'd kept the old tables now

Revision history for this message
Matteo Settenvini (tchernobog) wrote :

@Mathias: thanks, bug 316849 was the one for me. Now at least it's working.

Revision history for this message
Alfredo Deza (arufuredosan) wrote :

Hi,

I had the same problems when installing Mysql-server-5.1 and had to uncomment the line to skip-bdb.

Now to upgrade, I was getting the same errors as people in this thread.

The current problem was fixed for me doing the following:

sudo apt-get remove --purge mysql-server-5.1
sudo apt-get autoremove
sudo rm -rf /etc/mysql
sudo apt-get install mysql-server-5.1

At this point Mysql will complain that it can't read /etc/mysql/my.cnf but this is triggered because it no longer installs the configuration file named as my.cnf but as debian.cnf (Would this need be reported as another bug?)

After it complains do:
sudo cp -a /etc/mysql/debian.cnf /etc/mysql/my.cnf

Now once again:
sudo apt-get install mysql-server-5.1

This corrected everything for me and now I have mysql installed and working.

Revision history for this message
lann (lann) wrote :

Hi

yes it's OK for me too

Revision history for this message
Matteo Settenvini (tchernobog) wrote :

Broken again for me with mysql-server-5.1 version 5.1.30-2ubuntu4; fails upong trying to start the service. It was okay in the version before this by following directions as per bug 316849, so that's not the case anymore.

ChangeLog says:

mysql-dfsg-5.1 (5.1.30-2ubuntu4) jaunty; urgency=low

  [ Jonathan Riddell ]
  * Move data files to /usr/share/mysql-5.1 with
    --datadir=/usr/share/mysql-5.1 to make them co-installable with mysql 5.0
  * Update debian/rules for the above change
  * Split out /usr/share/mysql-5.1 into new mysql-server-data-5.1 package.
    These files are needed for embedded use of mysql (e.g. by Amarok).
  * Make mysql-server-5.1 conflict on mysql-server-core-5.0 (LP: #321185)

  [ Harald Sitter ]
  * Update all remaining references of usr/share/mysql/
  * Conflicts for the Kubuntu Intrepid deployment (subject for upgrade testing):
    + libmysqlclient16 replaces & conflicts amarok-libmysqlclient16
    + libmysqlclient16.dev replaces & conflicts amarok-libmysqlclient-dev
    + mysql-data-5.1 replaces & conflicts amarok-mysql-data
  * Link /usr/share/mysql-5.1/aclocal/mysql.m4 to /usr/share/aclocal/

 -- Harald Sitter <email address hidden> Tue, 20 Jan 2009 15:43:46 +0100

By the way, starting "mysqld" by hand via console, brings up the following error:
090128 22:23:38 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'

In fact, that file is now in '/usr/share/mysql-5.1/mysql/english/errmsg.sys', so I believe someone should fix it.

The complete output to the console is:

matteo@Dahlia:/usr/share/doc/mysql-server-5.1$ sudo mysqld
090128 22:29:20 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'
090128 22:29:21 InnoDB: Started; log sequence number 0 36380721
090128 22:29:21 [ERROR] Aborting

090128 22:29:21 InnoDB: Starting shutdown...
090128 22:29:22 InnoDB: Shutdown completed; log sequence number 0 36380721
090128 22:29:22 [Note]

Finally, running sudo /etc/mysql/debian-start brings this output:
Checking for corrupt, not cleanly closed and upgrade needing tables.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 316974] Re: Mysql dead after update

On Wed, Jan 28, 2009 at 09:31:48PM -0000, Matteo Settenvini wrote:
> By the way, starting "mysqld" by hand via console, brings up the following error:
> 090128 22:23:38 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'
>
> In fact, that file is now in
> '/usr/share/mysql-5.1/mysql/english/errmsg.sys', so I believe someone
> should fix it.

This is a setting set in /etc/mysql/my.cnf. You should be able to update
the language option in the file to point to
/usr/share/mysql-5.1/mysql/english/.

  status confirmed
  importance high

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Changed in mysql-dfsg-5.1:
importance: Undecided → High
status: Incomplete → Confirmed
Revision history for this message
Mathias Gug (mathiaz) wrote :

The fix is to remove the language option in /etc/mysq/my.cnf. The file is part of of mysql-common from the mysql-dfsg-5.0 source package.

Changed in mysql-dfsg-5.0:
assignee: nobody → mathiaz
importance: Undecided → High
status: New → In Progress
Changed in mysql-dfsg-5.1:
status: Confirmed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-dfsg-5.0 - 5.1.30really5.0.75-0ubuntu4

---------------
mysql-dfsg-5.0 (5.1.30really5.0.75-0ubuntu4) jaunty; urgency=low

  * debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.1. Setting the language option
    to use /usr/share/mysql/ breaks 5.1. Both 5.0 and 5.1 use a default value
    that works. (LP: #316974).

 -- Mathias Gug <email address hidden> Thu, 29 Jan 2009 16:01:31 -0500

Changed in mysql-dfsg-5.0:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.4 KiB)

This bug was fixed in the package mysql-dfsg-5.1 - 5.1.34-1ubuntu1

---------------
mysql-dfsg-5.1 (5.1.34-1ubuntu1) karmic; urgency=low

  * Merge from debian experimental (and 5.0 from main), remaining changes:
    - debian/mysql-server-5.1.config:
      + ask for MySQL root password at priority high instead of medium so
        that the password prompt is seen on a default install. (LP: #319843)
      + don't ask for root password when upgrading from a 5.0 install.
    - debian/control:
      + Make libmysqlclient16-dev a transitional package depending on
        libmysqlclient-dev.
      + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
      + Don't build mysql-server, mysql-client, mysql-common and
        libmysqlclient15-dev binary packages since they're still provided
        by mysql-dfsg-5.0.
      + Make mysql-{client,server}-5.1 packages conflict and
        replace mysql-{client,server}-5.0, but not provide
        mysql-{client,server}.
      + Depend on a specific version of mysql-common rather than the src
        version of mysql-dfsg-5.1 since mysql-common is currently part of
        mysql-dfsg-5.0.
      + Lower mailx from a Recommends to a Suggests to avoid pulling in
        a full MTA on all installs of mysql-server. (LP: #259477)
    - debian/rules:
      + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
        build failures.
      + install mysql-test and sql-bench to /usr/share/mysql/ rather than
        /usr/.
    - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
    - Add AppArmor profile:
      - debian/apparmor-profile: apparmor profile.
      - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
      - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
      - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
        purge.
      - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
      - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
      - debian/mysql-server-5.1.postinst: reload apparmor profiles.
    - debian/additions/my.cnf: remove language option. Error message files are
      located in a different directory in MySQL 5.0. Setting the language
      option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
      use a default value that works. (LP: #316974)
    - debian/mysql-server-5.1.mysql.init:
      + Clearly indicate that we do not support running multiple instances
        of mysqld by duplicating the init script.
        (closes: #314785, #324834, #435165, #444216)
      + Properly parameterize all existing references to the mysql config
        file (/etc/mysql/my.cnf).
    - debian/mysql-server-5.0.postinst: Clear out the second password
      when setting up mysql. (LP: #344816)
    - mysql-server-core-5.1 package for files needed by Akonadi:
      + debian/control: create mysql-server-core-5.1 package.
      + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
        move core mysqld files to mysql-server-core-5.1 package.
    - Don't package sql-bench and mysql-test file.
  * Dropped changes:
    - debian/patches/92_ssl_te...

Read more...

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
Mathias Gug (mathiaz) wrote :

Reopening for 5.1 - the mentioned bug number in the changelog is wrong.

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Fix Released → Triaged
status: Triaged → Fix Released
Revision history for this message
Mathias Gug (mathiaz) wrote :

Actually it's the correct bug. Marking Fix released again for 5.1.

Revision history for this message
ekinsokmen (ekin-sokmen) wrote :

The problem seems to be caused by some permission issue on mysql binary log files. After the upgrade mysql failed to start. Trying to start mysql service manually (service start mysql) also failed with following error:

100215 13:58:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100215 13:58:01 [Note] Plugin 'FEDERATED' is disabled.
100215 13:58:02 InnoDB: Started; log sequence number 0 698955389
^G/usr/sbin/mysqld: File './ekins-bin.000067' not found (Errcode: 13)
100215 13:58:02 [ERROR] Failed to open log (file './ekins-bin.000067', errno 13)
100215 13:58:02 [ERROR] Could not open log file
100215 13:58:02 [ERROR] Can't init tc log
100215 13:58:02 [ERROR] Aborting

in /var/lib/mysql directory these two files have root permission instead of mysql.
-rw-rw---- 1 root root 586 2010-02-15 14:08 ekins-bin.000069
-rw-rw---- 1 root root 712394 2010-02-15 14:08 ekins-bin.000070

After running "chown mysql:mysql /var/lib/mysql/*" I can start mysql manually running "service start mysql" and it works. But if I trigger dpkg to configure the failed packages mysql-server and mysql-server-5.1 same error occurs and permissions of last created bin files are set to "root" user again.

Revision history for this message
David Park (dparkmit) wrote :

Hi All,

I was wondering if a fix for this bug has been released? The status indicates that a fix has been released. But I'm not sure how to get it. I'm experiencing the same problem that @ekinsokmen reported. Any advice on how to get the fix would be greatly appreciated!

David

Revision history for this message
Gurgel (sven-ola-eriksson) wrote :

This just worked for me on a 64-bit Ubuntu 11.10 Desktop machine, when in Kernel.log and the syslog having:

init: mysql main process (15527) terminated with status 1
init: mysql main process ended, respawning
init: mysql post-start process (15528) terminated with status 1

Another symptom is that the mysqld keeps disappearing an reappearing among the processes in in the system monitor.
I guess that is the same that is stated in the files above.

If you decide to try workaround, make sure to make a backup of db-files.

Workaround:
>sudo apt-get remove --purge mysql-server-5.1
>sudo apt-get autoremove
>sudo rm -rf /etc/mysql
>sudo apt-get install mysql-server-5.1

I also choose to set a new root password for mysql.

Then I also did:
>sudo apt-get install mysql-admin

Well... This got the server running and Admin GUI to work for me.
I was able to log in as root.

Now lets see if I get the backup-ed data into mysql again ;)

komena (azizcom-komena)
Changed in mysql-dfsg-5.1 (Ubuntu):
assignee: nobody → komena (azizcom-komena)
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.