Red Hat Bugzilla – Bug 188563
Upgrade of FC4 mysql database causes mysqld crash
Last modified: 2013-07-02 23:09:06 EDT
Description of problem:
Version-Release number of selected component (if applicable):
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
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
Created attachment 127605 [details]
Mysqld log showing reproducible crashes through several attempts to restore a database
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.
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
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
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
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.