This documentation is for an older version. If you're using the most current version, select the documentation for that version with the version switch in the upper right corner of the online documentation, or by downloading a newer PDF or EPUB file.

2.19.2 Downgrading MySQL

2.19.2.1 Changes Affecting Downgrades from MySQL 5.0

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

Supported Downgrade Methods

Supported downgrade methods include:

Supported Downgrade Paths

Unless otherwise documented, the following downgrade paths are supported:

The following conditions apply to all downgrade paths:

Before You Begin

Before downgrading, the following steps are recommended:

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.19.2.1, “Changes Affecting Downgrades from MySQL 5.0” for steps to be performed before downgrading.

  2. If you use InnoDB, configure MySQL to perform a slow shutdown. 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. Stop the newer MySQL server.

  4. Downgrade the MySQL binaries or packages in-place by replacing the newer binaries or packages with the older ones.

  5. Start the older (downgraded) MySQL server.

  6. 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.19.2.1, “Changes Affecting Downgrades from MySQL 5.0” for steps to be performed before downgrading.

  2. Dump all databases. For example:

    shell> bin/mysqldump --add-drop-table --skip-routines --skip-triggers -u root -ppassword 
        -> --all-databases --force > all_5_0_databases_dump.sql
  3. Stop the newer MySQL server.

  4. Initialize the older MySQL instance using an empty data directory. For example:

    shell> scripts/mysql_install_db --user=mysql
  5. Start the older MySQL server.

  6. Load the dump file into the older MySQL server. For example:

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

    shell> bin/mysql_upgrade -u root -ppassword
  8. If you use InnoDB, configure MySQL to perform a slow shutdown. 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.

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