As of XAMPP 5.5.30 and 5.6.14, XAMPP ships MariaDB instead of MySQL. MariaDB is not 100% compatible with MySQL and can be replaced with the "orginal" MySQL server.
- Windows
- XAMPP for Windows
- Administrator privileges to restart Windows services
- Backup the old database into a sql dump file
- Stop the MariaDB service
- Rename the folder:
c:\xampp\mysql
toc:\xampp\mariadb
- Download MySQL Community Server: https://dev.mysql.com/downloads/mysql/
- Goto: Other Downloads > ZIP Archive 5.7.22 (mysql-5.7.22-win32.zip) > No thanks, just start my download.
- Create a new and empty folder:
c:\xampp\mysql
- Extract
mysql-5.7.22-win32.zip
to:c:\xampp\mysql
- Create a new file:
c:\xampp\mysql\my.ini
and copy this content:
[mysqld]
# Set basedir to your installation path
basedir=c:/xampp/mysql
# Set datadir to the location of your data directory
datadir=c:/xampp/mysql/data
# Default: 128 MB
# New: 1024 MB
innodb_buffer_pool_size = 1024M
-
Copy the old
data
directory fromc:\xampp\mariadb\data
toc:\xampp\mysql\data
-
Start the MySQL server. You can use the XAMPP Control Panel (MySQL > Start) to start the MySQL service.
-
Repair all corrupted tables in the
c:\xampp\mysql\data
directory. Press ENTER if your password is empty.
cd c:\xampp\mysql\bin
mysqlcheck.exe -u root -p --auto-repair --all-databases
Update structure to latest version:
mysql_upgrade.exe -u root -p --force
Check the tables for errors:
mysqlcheck.exe -u root -p --check --all-databases
Notice: If you don't want to copy and migrate the old data
directory, you can create a fresh directory
with this command:
c:\xampp\mysql>bin\mysqld.exe --initialize-insecure --basedir=c:\xampp\mysql --datadir=c:\xampp\mysql\data
Click the Github ★ Star button :-)
- I can't start or stop mysql using the XAMPP control panel button
- The XAMPP control panel is crashing while shutting down
- Make sure you have installed the 32-bit version of MySQL. The MySQL 64-bit version is not compatible with the XAMPP Control Panel.
- This setup is not testet with MySQL 8.x
- Try to fix the directory permissions with this batch script