Mike
Mike

Reputation: 755

How can I change MariaDB to MySQL in XAMPP?

A. First things first:

  1. Mr. Google hasn't helped me to found any reply to my question above
  2. Yes, I have read a solution to the opposite question here How to upgrade MySQL to MariaDB in XAMPP in 5 minutes on Windows (and it hasn't helped me: MySQL simply doesn't start)
  3. I don't expect replies like 'MariaDB is better, - stop your silly exercises'.

B. I am working with MySQL Workbench and because of that don't want to face any incompatibilities either now or in future.

C. Can someone share their experience (if any) in solving this problem?

Upvotes: 48

Views: 132281

Answers (5)

Jesher
Jesher

Reputation: 11

I don't have enough reputation to add a comment, but just an extra note (add on to the amazing answer by emkey08), if the zip archive you download is 8.4 or later, the 'mysql_native_password' plugin is deprecated, and for version 9.0.0 onwards it is removed, so you can use 'caching_sha2_password' plugin instead.

ALTER USER root@localhost IDENTIFIED WITH caching_sha2_password BY '';
ALTER USER pma@localhost IDENTIFIED WITH caching_sha2_password BY '';

more info on the Caching SHA-2 plugin

Upvotes: 0

emkey08
emkey08

Reputation: 6161

Running XAMPP with MySQL

Here are exact step by step instructions for truly integrating MySQL into XAMPP on Windows. This has been successfully tested with Windows 10 and XAMPP 7.3.11 for both MySQL 8.0.18 and 5.7.28.

  • Stop MySQL (which actually is MariaDB) in the XAMPP Control Panel.
  • Download the MySQL community server as zip archive (Windows 64 bit version)
  • Rename C:\xampp\mysql to C:\xampp\mariadb
  • Extract the downloaded zip archive to C:\xampp\mysql. Make sure you extract the folder level which has the subfolders bin, include, lib etc.
  • Copy C:\xampp\mariadb\bin\my.ini to C:\xampp\mysql\bin
  • Open C:\xampp\mysql\bin\my.ini in an editor and comment out the line starting with key_buffer= in the [mysqld] section.
  • Open a command prompt and run the following commands:

    For MySQL 8.0.18:

    cd C:\xampp\mysql
    bin\mysqld --initialize-insecure
    start /b bin\mysqld
    bin\mysql -u root
        CREATE USER pma@localhost;
        SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
        GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma@localhost;
        ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '';
        ALTER USER pma@localhost IDENTIFIED WITH mysql_native_password BY '';
        \q
    bin\mysqladmin -u root shutdown
    

    For MySQL 5.7.28:

    cd C:\xampp\mysql
    bin\mysqld --initialize-insecure --log_syslog=0
    start /b bin\mysqld --log_syslog=0
    bin\mysql -u root
        CREATE USER pma@localhost;
        SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
        GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma@localhost;
        \q
    bin\mysqladmin -u root shutdown
    
  • Start Apache and MySQL in the XAMPP Control Panel.

  • Go to http://localhost/phpmyadmin and verify that your database server is now reported as MySQL Community Server.

Upvotes: 84

Manfred
Manfred

Reputation: 1000

I just upgraded XAMPP because of PHP 7. I am also using mysql workbench. I want to be as close to production as I can, but my webhoster supports only mysql. These where my reasons to switch back from mariadb to mysql

I followed these steps: (also max 5min) https://gist.github.com/odan/c799417460470c3776ffa8adce57eece

Upvotes: 2

ARUN Madathil
ARUN Madathil

Reputation: 936

You have to do little adjustment with xampp in order to use MySQL instead of MariaDB . I just did following and its worked , i think it may helpful to others also.

  1. Download and install mysql installer.

2.stop xampp and rename the mysql folder inside the xampp directory(may be its not necessary! )

3.just start Apache only from xampp control panel . No need to start mysql.

4.Last step . Make sure your running MySQL in your system . That's it ..

Check php admin panel there you can see Server type: MySQL instead of MariaDB ...

Thanks..

Upvotes: 3

Vinee
Vinee

Reputation: 1654

You can use the following way.

  1. Stop MariaDB in Xampp which show as mysql running...
  2. Download the installer for windows mysql Installer
  3. Follow the instruction.
  4. Now start Apache2 and clear cookie in your browser. Now you can see phpmyadmin and workbench showing Server type: MySQL

If you want to stick to MariaDB then you can use sqlyog also.

Hope it answer your question

Upvotes: 17

Related Questions