Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.3Mb
PDF (A4) - 31.4Mb
PDF (RPM) - 29.8Mb
HTML Download (TGZ) - 7.4Mb
HTML Download (Zip) - 7.5Mb
HTML Download (RPM) - 6.4Mb
Man Pages (TGZ) - 177.2Kb
Man Pages (Zip) - 287.5Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb
Excerpts from this Manual

MySQL 5.6 Reference Manual  /  ...  /  Downgrading Binary and Package-based Installations on Unix/Linux

2.11.2.4 Downgrading Binary and Package-based Installations on Unix/Linux

This section describes how to downgrade MySQL binary and package-based installations on Unix/Linux. In-place and logical downgrade methods are described.

In-Place Downgrade

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 existing data directory.

In-place downgrade is supported for downgrades between GA releases within the same release series.

In-place downgrade is not supported for MySQL APT, SLES, and Yum repository installations.

To perform an in-place downgrade:

  1. Review the information in Section 2.11.2.1, “Before You Begin”.

  2. 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.

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

    mysql -u root -p --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.

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

    mysqladmin -u root -p shutdown
  5. 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.

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

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

    mysqld_safe --user=mysql --datadir=/path/to/existing-datadir
  8. Run mysql_upgrade. For example:

    mysql_upgrade -u root -p
  9. Shut down and restart the MySQL server to ensure that any changes made to the system tables take effect. For example:

    mysqladmin -u root -p shutdown
    mysqld_safe --user=mysql --datadir=/path/to/existing-datadir
Logical Downgrade

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 releases within the same release series and for downgrades to the previous release level. Only downgrades between General Availability (GA) releases are supported. Before proceeding, review Section 2.11.2.1, “Before You Begin”.

Note

For MySQL APT, SLES, and Yum repository installations, only downgrades to the previous release level are supported. Where the instructions call for initializing an older instance, use the package management utility to remove MySQL 5.6 packages and install MySQL 5.5 packages.

To perform a logical downgrade:

  1. Review the information in Section 2.11.2.1, “Before You Begin”.

  2. Dump all databases. For example:

    mysqldump -u root -p
      --add-drop-table --routines --events
      --all-databases --force > data-for-downgrade.sql
  3. Shut down the newer MySQL server. For example:

    mysqladmin -u root -p shutdown
  4. Initialize an older MySQL instance, with a new data directory. For example:

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

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

    mysql -u root -p --force < data-for-upgrade.sql
  7. Run mysql_upgrade. For example:

    mysql_upgrade -u root -p
  8. Shut down and restart the MySQL server to ensure that any changes made to the system tables take effect. For example:

    mysqladmin -u root -p shutdown
    mysqld_safe --user=mysql --datadir=/path/to/new-datadir

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.