XAMPP - Replacing MariaDB with MySQL 8

17 Nov 2019

The latest version of XAMPP contains MariaDB instead of MySQL.

But MariaDB is not 100% compatible with MySQL and can be replaced with the “orginal” MySQL server.

Requirements

Backup

Installation

[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

# Default since MySQL 8: caching_sha2_password
default_authentication_plugin=mysql_native_password

[client]
ssl-mode=DISABLED

Initializing the data directory

cd c:\xampp\mysql\bin
mysqld.exe --default-authentication-plugin=mysql_native_password --initialize-insecure --basedir=c:\xampp\mysql --datadir=c:\xampp\mysql\data

Start the MySQL service (in your XAMPP Control Panel)

Data restore

Import the SQL dump file into the new database.

Done.

Known issues

Questions

Q: I get Authentication plugin 'caching_sha2_password' cannot be loaded

A: MySQL 8 uses caching_sha2_password as default authentication plugin.

Q: I get mysqldump: Got error: 2026: SSL connection error: error:00000000:lib(0):func(0):reason(0) when trying to connect

A: Add the [client] ssl-mode=DISABLED option to your my.ini file

Q: I can’t start or stop MySQL using the XAMPP control panel button.

A: Make sure you have installed the 64-bit version of XAMPP and MySQL.

Comments