Select Page
This entry has been published on 2014-07-10 and may be out of date.

Last Updated on 2014-07-10.

Scenario

You run a Windows server with MySQL DB, want to keep it up to date, keep all settings and the upgrade process should work as fast as possible.

Unfortunately, the official MySQL upgrading guides are too detailed in most cases, however they don’t really explain clear how to do e.g. a simple upgrade from 5.1 or 5.5. to 5.6 and keep your data and settings.

Steps for upgrading

  1. Stop the MySQL service (and other services which need the DBs, if necessary).
  2. Uninstall MySQL (Windows search -> programs and features). The data stays in c:programdata.
  3. Download and install the current version of MySQL. At the moment this is 5.6.19, but this guide should work for earlier and later versions. Use “add / install features/products” option, the update option does not work if the “version jump” is too large.
  4. Don’t run the Instance Config after installation (close the wizard). It only works well for new installations. As you want to keep your settings, you do not want to have a new my.ini etc. to be written.
  5. Copy c:program filesmysqlMySQL Server xxmy.ini to the new installation directory.
  6. Open my.ini in the new directory and modify the 2 absolute paths (e.g. change “5.5” to “5.6” in the program and data path line).
  7. Copy c:programdatamysqlMySQL Server xxdata to the new data directory.
  8. (Optional) Modify the runtime environment path with the System variables Windows dialog.
  9. Install MySQL Windows service by opening command line and enter “[your-path-to-mysql-bin]mysqld -install MySQL”
  10. Run the service.
  11. If it cannot get started, have a look at the Windows event log “Application”. You might have to modify or remove some definitions of your my.ini. Then try again to start the service.
  12. To be safe, run [your-path-to-mysql-bin]mysql_upgrade
  13. You are done. Test if everything works, then delete several folders of your old MySQL installation.

Note

I recommend the above steps e.g. for home users who use it with non-critical data like MediaCenter data (MediaPortal, XBMC etc.) where the upgrade process should be done within minutes. If you are in a production environment, of course you have to be more careful and in this case the official MySQL tutorials are right for you.

In addition, I assume you use the default paths.