This section describes what you should do to downgrade to an older MySQL version in the unlikely case that the previous version worked better than the new one.
If you are downgrading within the same release series (for example, from 4.1.13 to 4.1.12) the general rule is that you just have to install the new binaries on top of the old ones. There is no need to do anything with the databases. As always, however, it is always a good idea to make a backup.
The following items form a checklist of things you should do whenever you perform a downgrade:
-
Read the upgrading section for the release series from which you are downgrading to be sure that it does not have any features you really need. Section 2.11, “Upgrading MySQL”.
-
If there is a downgrading section for that version, you should read that as well.
In most cases, you can move the MySQL format files and data files between different versions on the same architecture as long as you stay within versions for the same release series of MySQL.
If you downgrade from one release series to another, there may be
incompatibilities in table storage formats. In this case, you can
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.3, “Copying MySQL Databases to Another Machine”.
The normal symptom of a downward-incompatible table format change when you downgrade is that you can't open tables. In that case, use the following procedure:
-
Stop the older MySQL server that you are downgrading to.
-
Restart the newer MySQL server you are downgrading from.
-
Dump any tables that were inaccessible to the older server by using mysqldump to create a dump file.
-
Stop the newer MySQL server and restart the older one.
-
Reload the dump file into the older server. Your tables should be accessible.
MySQL 4.1 does not support stored routines or triggers. If your
databases contain stored routines or triggers, prevent them from
being dumped when you use mysqldump by using
the --skip-routines
and
--skip-triggers
options. (See
Section 8.12, “mysqldump — A Database Backup Program”.)
MySQL 4.1 does not support views. If your databases contain
views, remove them with DROP VIEW
before
using mysqldump. (See
Section 19.3, “DROP VIEW
Syntax”.)
After downgrading from MySQL 5.0, you may see the following
information in the mysql.err
file:
Incorrect information in file: './mysql/user.frm'
In this case, you can do the following:
-
Start MySQL 5.0.4 (or newer).
-
Run mysql_fix_privilege_tables, which will change the
mysql.user
table to a format that both MySQL 4.1 and 5.0 can use. -
Stop the MySQL server.
-
Start MySQL 4.1.
If the preceding procedure fails, you should be able to do the following instead:
-
Start MySQL 5.0.4 (or newer).
-
Run mysqldump --opt --add-drop-table mysql > /tmp/mysql.dump.
-
Stop the MySQL server.
-
Start MySQL 4.1 with the
--skip-grant
option. -
Run mysql mysql < /tmp/mysql.dump.
-
Run mysqladmin flush-privileges.