Upgrading MySQL on-board XAMPP

XAMPP is a great package of Apache, MySQL, phpmyadmin and some others (actually the best I’ve ever used). The only disadvantage of it, is that guys behind this project haven’t got much spare time and update it fairly slow. Newest XAMPP version (1.8.1) is over a year old now and still has MySQL 5.1.41 on-board, while version 5.6.10 is available for download, as of writing this. Here are some tips on manually upgrading MySQL on-board your XAMPP package.

Simple copy & folder switch does the job and is enough to upgrade MySQL on-board XAMPP from 5.1.41 to 5.6.10. However there are slight side effects, you must consider.

Upgrade & Migration

Simply, follow these steps:

  1. Turn off everything about XAMPP (all servers you’ve started up).
  2. If you have MySQL installed as service (tick Svc next to MySQL checked) — uninstall it (uncheck).
  3. Rename mysql folder inside XAMPP to mysql_old or something similar,
  4. Create new mysql folder and unzip freshly new MySQL into it.

As for data migration (if you have any), you can do this by either exporting data from old MySQL (before installing new version, i.e. before executing above steps) using phpMyAdmin or similar tool and then importing it into new version of MySQL.

Or you can consider a bruteforce mode, that is — copying whole contents of mysql_old/data folder to mysql/data folder, merging or overwriting contents that you’ve already have there. It did worked for me, but But no guarantee, this will work for you.

Side effects

There must be some problem with XAMPP being unable to start new version of MySQL. I was able to run new version of MySQL with c:XAMPPmysqlbinmysqld.exe, though all attempts to run is from XAMPP Control Panel failed.

If you’re interested, you can ask at Apache Friend’s forum, what magic do they made, so you can start mysqld.exe manually, but can’t start MySQL from XAMPP Control Panel after upgrade.

New version of MySQL is enormous, because XAMPP guys are doing great optimization. For example, only key folders (these, that I had in mysql_old) have 931 MB in 5.6.10, while optimized XAMPP edition of 5.1.41 have the same folders with only 75 MB. Entire 5.6.10 edition has 1084 MB, that is nearly 13 times more! For this and for convenience of starting MySQL from XAMPP Control Panel, I decided to stay on 5.1.41.

Checking

After upgrade I run my localhost application and was able to verify, that it runs without any problems under new MySQL and all data is restored. With this code:

mysql_connect('srv', 'user', 'pass');
printf ("MySQL server version: %sn", mysql_get_server_info());

I managed to verify that my PHP (XAMPP) runs under new version of MySQL (5.6.10).

Conlusion

Manual upgrade of MySQL version under XAMPP package is possible and it doesn’t require to much work or time. However, side effects, you most likely run while doing this, may not be acceptable by all.

BTW: You can use similar path to upgrade phpMyAdmin or mail server or any other component of XAMPP.

Leave a Reply