Upgrading from MySQL 5.0 to 5.1

After upgrading a 5.0 installation to 5.0.10 or above, it is necessary to upgrade your grant tables. Otherwise, creating stored procedures and functions might not work. To perform this upgrade, run mysql_upgrade.


It is good practice to back up your data before installing any new version of software. Although MySQL works very hard to ensure a high level of quality, you should protect your data by making a backup.

To upgrade to 5.1 from any previous version, MySQL recommends that you dump your tables with mysqldump before upgrading and reload the dump file after upgrading. Use the --all-databases option to include all databases in the dump. If your databases include stored programs, use the --routines and --events options as well.

If you perform a binary (in-place) upgrade without dumping and reloading tables, you cannot upgrade directly from MySQL 4.1 to 5.1. This occurs due to an incompatible change in the MyISAM table index format in MySQL 5.0. Upgrade from MySQL 4.1 to 5.0 and repair all MyISAM tables (see Section 2.13.4, “Rebuilding or Repairing Tables or Indexes”). Then upgrade from MySQL 5.0 to 5.1 and check and repair your tables.

In general, you should do the following when upgrading from MySQL 5.0 to 5.1:

If your MySQL installation contains a large amount of data that might take a long time to convert after an in-place upgrade, you might find it useful to create a dummy database instance for assessing what conversions might be needed and the work involved to perform them. Make a copy of your MySQL instance that contains a full copy of the mysql database, plus all other databases without data. Run your upgrade procedure on this dummy instance to see what actions might be needed so that you can better evaluate the work involved when performing actual data conversion on your original database instance.

The following lists describe changes that may affect applications and that you should watch out for when upgrading from MySQL 5.0 to 5.1.

Configuration Changes
Server Changes
SQL Changes
C API Changes