MySQL 5.0 Restore 4.1 Databases on Windows

I just installed MySQL 5.0.27 today. I used to use MySQL 4.1.x, but I decided that I’d move to 5.0.x since it is now the GA release. I had all my previous databases backed up in their binary format, and since I didn’t have MySQL 4.1 installed when I installed 5.0.x, it did not update my tables. The interesting note about that is that on Windows, the process to do this manually is not as easy as it should be. Here are the steps:

  1. Stop the MySQL service (net stop mysql).
  2. Move the binary files into the new /data/ directory.
  3. Delete ib_logfile0 and ib_logfile1 if they exist.
  4. Start the MySQL service (net start mysql).
  5. mysqlcheck --check-upgrade --all-databases --auto-repair --user=root --password
  6. mysql --database=mysql --user=root --password
  7. mysql> source c:\mysql\scripts\mysql_fix_priviledge_tables.sql
  8. And now you’re all done!

One Comment

  1. Gerry says:

    Thanks Doug. Great solution, easy and reliable. Love it!

Leave a Reply to Gerry