2.7. Upgrading MySQL

New versions of MySQL are released periodically, and you can upgrade from one version of MySQL to a newer version. You can find upgrading information in the MySQL manual at http://dev.mysql.com/doc/refman/5.0/en/upgrade.html.

However, there are special considerations when you upgrade. As a precaution, back up your current databases, including the GRANT tables in the mysql database, before upgrading.

MySQL recommends that you don't skip versions. If you want to upgrade from one version to a version more than one version newer, such as from MySQL 4.0 to MySQL 5.0, you should upgrade to the next version first. After that version is working correctly, you can upgrade to the next version, and so on. In other words, upgrade from 4.0 to 4.1, then from 4.1 to 5.0.

Occasionally, incompatible changes are introduced in new versions of MySQL. Some releases introduce changes to the structure of the GRANT tables. For instance, MySQL 4.1 changed the method of encrypting passwords, requiring a longer password field in the GRANT tables.

After upgrading to the newer version, you should run the mysql_upgrade script. It repairs your files and upgrades the system tables, if needed. In versions prior to MySQL version 5.0.19, the mysql_upgrade script doesn't run on Windows; it runs only on Unix. On Windows, you can run a script called mysql_fix_privileges_tables with MySQL versions prior to 5.0.19. The script upgrades the system tables but doesn't perform the complete table check ...

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.