Bug 188563 - Upgrade of FC4 mysql database causes mysqld crash
Upgrade of FC4 mysql database causes mysqld crash
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2006-04-11 06:22 EDT by Simon Andrews
Modified: 2013-07-02 23:09 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-04 03:55:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Mysqld log showing reproducible crashes through several attempts to restore a database (9.61 KB, text/plain)
2006-04-11 06:22 EDT, Simon Andrews
no flags Details
Before and after of an SQL dump showing modifications (2.57 KB, text/plain)
2006-04-11 06:44 EDT, Simon Andrews
no flags Details

  None (edit)
Description Simon Andrews 2006-04-11 06:22:29 EDT
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:
Always (with our database at least)

Steps to Reproduce:
1. Create a database in mysql on an older fedora
2. Upgrade to FC5
3. Try to issue a grant statement
Actual results:

mysqld segfaults

Expected results:

Additional info:

The problem seems to be caused by a change in the structure of the mysql (ie
permissions) database between older and newer versions of mysql.  The new
version creates a load of extra columns which aren't present in previous
versions and these seem to cause problems for the new version.

Because the table structure has changed then it's not possible to recover just
by restoring an SQL dump from an old database, as this restores the broken
Comment 1 Simon Andrews 2006-04-11 06:22:30 EDT
Created attachment 127605 [details]
Mysqld log showing reproducible crashes through several attempts to restore a database
Comment 2 Simon Andrews 2006-04-11 06:30:05 EDT
I found a work round for this.  It's a bit involved, but it does get everything
running again.  It assumes you have a full SQL backup (if not then myslqdump may
still work on a database with problems - I didn't try):

1) Stop mysqld (service mysqld stop)

2) Move the mysql base directory (probably /var/lib/mysqk) to another name

3) Start mysqld (this will recreate a base set of mysql databases with the
correct table structure)

4) Restore your SQL backup, but exclude the mysql database section

5) Edit the mysql database restore to remove the table creation statements and
edit the insert statements to specify the columns being inserted (I'll attach a
before and after showing what I mean if this isn't clear).  You also need to add
a delete * from [table_name] for each table in mysql to avoid getting duplicate
entries (eg for root).

6) Restore the modified mysql backup.

7) Flush privileges in the database

Everthing should now start working again.  Once you're happy you can remove the
old mysql files from wherever you moved them in step 2.

Comment 3 Simon Andrews 2006-04-11 06:44:30 EDT
Created attachment 127606 [details]
Before and after of an SQL dump showing modifications

This attachment shows the modifications you need to make to an SQL dump of an
old mysql version database to bring the privileges into a new FC5 database.  It
only shows one modified table within the 'mysql' database, but you'd actually
need to do the same thing for every table within 'mysql' which contained any
Comment 4 Bug Zapper 2008-04-03 22:37:17 EDT
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
Comment 5 Simon Andrews 2008-04-04 03:55:25 EDT
I've not been able to check, but the problem I originally reported boiled down
to the fact that when mysql was upgraded from an older version the
mysql_fix_privileges_tables script wasn't run.

Ideally I'd have liked this run in %post, but I suspect this isn't technically
possible without user interaction.  I notice also that there is a link in the
release notes to the mysql upgrade information which mentions this.

Note You need to log in before you can comment on or make changes to this bug.