Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.4Mb
PDF (A4) - 31.5Mb
PDF (RPM) - 30.0Mb
EPUB - 7.7Mb
HTML Download (TGZ) - 7.5Mb
HTML Download (Zip) - 7.5Mb
HTML Download (RPM) - 6.5Mb
Eclipse Doc Plugin (TGZ) - 8.2Mb
Eclipse Doc Plugin (Zip) - 10.1Mb
Man Pages (TGZ) - 180.8Kb
Man Pages (Zip) - 291.9Kb
Info (Gzip) - 2.8Mb
Info (Zip) - 2.8Mb
Excerpts from this Manual

2.11.2 Downgrading MySQL

This section describes how to downgrade to an older MySQL version.

Supported Downgrade Methods

Supported downgrade methods include:

  • In-place Downgrade: Involves shutting down the new MySQL version, replacing the new MySQL binaries or packages with the old ones, and restarting the old MySQL version on the new data files. In-place downgrades are supported for downgrades between GA versions within the same release series. For example, in-place downgrades are supported for downgrades from 5.6.27 to 5.6.26.

  • Logical Downgrade: Involves using mysqldump to dump all tables from the new MySQL version, and then loading the dump file into the old MySQL version. Logical downgrades are supported for downgrades between GA versions within the same release series and for downgrades between release levels. For example, logical downgrades are supported for downgrades from 5.6.27 to 5.6.26 and for downgrades from 5.6 to 5.5.

Supported Downgrade Paths

Unless otherwise documented, the following downgrade paths are supported:

  • Downgrading from a release series version to an older release series version is supported using all downgrade methods. For example, downgrading from 5.6.27 to 5.6.26 is supported. Skipping release series versions is also supported. For example, downgrading from 5.6.27 to 5.6.25 is supported.

  • Downgrading one release level is supported using the logical downgrade method. For example, downgrading from 5.6 to 5.5 is supported.

  • Downgrading more than one release level is supported using the logical downgrade method, but only if you downgrade one release level at a time. For example, you can downgrade from 5.6 to 5.5, and then to 5.1.

The following conditions apply to all downgrade paths:

  • Downgrades between General Availability (GA) status releases are supported.

  • Downgrades between milestone releases (or from a GA release to a milestone release) are not supported. For example, downgrading from MySQL 5.6.10 to MySQL 5.6.9 is not supported, as 5.6.9 is not a GA status release.

Before You Begin

Before downgrading, the following steps are recommended:

  • Review the Release Notes for the MySQL version you are downgrading from to ensure that there are no features or fixes that you really need.

  • Review Section 2.11.2.1, “Changes Affecting Downgrades from MySQL 5.6”. This section describes changes that may require action before or after downgrading.

    Note

    The downgrade procedures described in the following sections assume you are downgrading with data files created or modified by the newer MySQL version. However, if you did not modify your data after upgrading, downgrading using backups taken before upgrading to the new MySQL version is recommended. Many of the changes described in Section 2.11.2.1, “Changes Affecting Downgrades from MySQL 5.6” that require action before or after downgrading are not applicable when downgrading using backups taken before upgrading to the new MySQL version.

  • Always back up your current databases and log files before downgrading. The backup should include the mysql database, which contains the MySQL system tables. See Section 7.2, “Database Backup Methods”.

  • Use of new features, new configuration options, or new configuration option values that are not supported by a previous release may cause downgrade errors or failures. Before downgrading, it is recommended that you reverse changes resulting from the use of new features and remove configuration settings that are not supported by the release you are downgrading to.

  • Check Section 2.11.3, “Checking Whether Tables or Indexes Must Be Rebuilt”, to see whether changes to table formats or to character sets or collations were made between your current version of MySQL and the version to which you are downgrading. If such changes have resulted in an incompatibility between MySQL versions, downgrade the affected tables using the instructions in Section 2.11.4, “Rebuilding or Repairing Tables or Indexes”.

  • If you use XA transactions with InnoDB, run XA RECOVER before downgrading to check for uncommitted XA transactions. If results are returned, either commit or rollback the XA transactions by issuing an XA COMMIT or XA ROLLBACK statement.

Performing an In-place Downgrade

In-place downgrades are supported for downgrades between GA status releases within the same release series. Review Before you Begin before proceeding.

To perform an in-place downgrade:

  1. Review the changes described in Section 2.11.2.1, “Changes Affecting Downgrades from MySQL 5.6” for steps to be performed before downgrading.

  2. If you use InnoDB, configure MySQL to perform a slow shutdown by setting innodb_fast_shutdown to 0. For example:

    shell> bin/mysql -u root -ppassword --execute="set global innodb_fast_shutdown=0"

    With a slow shutdown, InnoDB performs a full purge and change buffer merge before shutting down, which ensures that data files are fully prepared in case of file format differences between releases.

  3. Shut down the newer MySQL server. For example:

    shell> bin/mysqladmin -u root -ppassword shutdown
  4. After the slow shutdown, remove the InnoDB redo log files (the ib_logfile* files) from the data directory to avoid downgrade issues related to redo log file format changes that may have occurred between releases.

    shell> rm ib_logfile*
  5. Downgrade the MySQL binaries or packages in-place by replacing the newer binaries or packages with the older ones.

  6. Start the older (downgraded) MySQL server, using the existing data directory. For example:

    shell> bin/mysqld_safe --user=mysql --datadir=/path/to/existing-datadir
    
  7. Run mysql_upgrade. For example:

    shell> bin/mysql_upgrade -u root -ppassword

Performing a Logical Downgrade

Logical downgrades are supported for downgrades between releases within the same release series and for downgrades to the previous release level. Only downgrades between General Availability (GA) status releases are supported. Review Before you Begin before proceeding.

To perform a logical downgrade:

  1. Review the changes described in Section 2.11.2.1, “Changes Affecting Downgrades from MySQL 5.6” for steps to be performed before downgrading.

  2. Dump all databases. For example:

    shell> bin/mysqldump --add-drop-table --events -u root -ppassword --all-databases --force > all_5_6_databases_dump.sql
  3. Shut down the newer MySQL server. For example:

    shell> bin/mysqladmin -u root -ppassword shutdown
  4. Initialize an older MySQL instance, with a new data directory. For example:

    shell> scripts/mysql_install_db --user=mysql
  5. Start the older MySQL server, using the new data directory. For example:

    shell> bin/mysqld_safe --user=mysql --datadir=/path/to/new-datadir
    
  6. Load the dump file into the older MySQL server. For example:

    shell> bin/mysql -u root -ppassword --execute="source all_5_6_databases_dump.sql" --force
  7. Run mysql_upgrade. For example:

    shell> bin/mysql_upgrade -u root -ppassword
  8. Configure MySQL to perform a slow shutdown by setting innodb_fast_shutdown to 0. For example:

    shell> bin/mysql -u root -ppassword --execute="set global innodb_fast_shutdown=0"
  9. Shut down and restart the MySQL server to ensure a clean shutdown and startup. For example:

    shell> bin/mysqladmin -u root -ppassword shutdown
    shell> bin/mysqld_safe --user=mysql --datadir=/path/to/new-datadir
    

Downgrade Troubleshooting

If you downgrade from one release series to another, there may be incompatibilities in table storage formats. In this case, use mysqldump to dump your tables before downgrading. After downgrading, reload the dump file using mysql or mysqlimport to re-create your tables. For examples, see Section 2.11.5, “Copying MySQL Databases to Another Machine”.

A typical symptom of a downward-incompatible table format change when you downgrade is that you cannot open tables. In that case, use the following procedure:

  1. Stop the older MySQL server that you are downgrading to.

  2. Restart the newer MySQL server you are downgrading from.

  3. Dump any tables that were inaccessible to the older server by using mysqldump to create a dump file.

  4. Stop the newer MySQL server and restart the older one.

  5. Reload the dump file into the older server. Your tables should be accessible.


User Comments
  Posted by joshua paul on December 12, 2008
How to uninstall / downgrade on Mac OS X?

http://www.macosxhints.com/article.php?story=2008111115225247

After a bit of digging, I found the cause and the solution. The MySQL installer checks for the existence of other MySQL versions by looking in the /Library/Receipts folder, not by looking for an actual installed version of MySQL. So I deleted the MySQL receipts folder I found in /Library/Receipts

-- source robg

Also I had errors because I had a ".my.cnf" in my user folders ie. /Users/username/.my.cnf - which specified files from a previous version - deleting that fixed the problem...
  Posted by Mathias Karlsson on May 31, 2011
For downgrades from 5.5 to 5.1, the mysql.proc table can be fixed by executing
ALTER TABLE `mysql`.`proc` MODIFY COLUMN `comment` CHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';
Sign Up Login You must be logged in to post a comment.