Upgrading to MySQL 5

After the upgrade to PHP 5, I also upgraded to MySQL 5, from 3.23. Again, no major issues arose that weren’t fixed quickly.

ISAM Tables

MySQL does not support ISAM tables as of version 5. In version 4, they were still supported, and MySQL provided a script that upgraded the tables to MyISAM (the newer, better format). MySQL used MyISAM by default since version 3.23, so this didn’t cause any headaches for me. In fact, the issue only arose on one site, which was one I took over hosting for about a year ago. It was an old site that was built before MySQL 3.23 was released, but was heavily modified since. A handful of the tables were still in the older ISAM format and thus, not supported by MySQL 5.

I searched the Internet for a solution to the problem and found that the issue was quite common, but no quick and easy fix was available. One article actually suggested rolling back to version 3, then upgrading to MySQL 4, running the table converter script, and then upgrading to version 5. I didn’t want to do that much work, when only one site was affected, especially because I didn’t want any further problems to arise from all the installing/uninstalling.

The quick solution, was actually quite easy. Before I do anything at all to my database, I create a dump file using mysqldump, (essentially a backup of the entire database). When viewing the script, it includes the table format at the end of each Create table clause. In my dump file, I found that the affected tables had Type=ISAM in place, where each of my other tables had Type=MyISAM. All I had to do was update the Type=ISAM to Type=MyISAM, and then restore the database with the dump file. When the dump file re-created the database tables, it used the proper table types and the problem was solved. Finally, the quick and easy solution to the problem.

Comment