43

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mike
  • 595
  • 1
  • 5
  • 10
  • 1
    operating system? version of XAMPP? version of mysql? error messages when you try and start mysql? Try and start it from the command line - you will see the error message immediately. some clues please. Ensure MariaDB is not running. Remember, we cannot see your screen. Please add the information to your question. Please don't post the answers in comments. – Ryan Vincent Sep 23 '16 at 08:35
  • OS -> Windows 7 Enterprise SP1, XAMPP 5.5.30-7 (inside -> MariaDB 10.1.10), mysql-5.5.52-win32.zip (from https://dev.mysql.com), when I start mysql from console - it opens and closes immediately (so - nothing to see) – Mike Sep 23 '16 at 08:44
  • being in folder '\xampp\mysql\bin' I start 'cmd' and type 'mysqld -install' , then open 'cmd' and type 'net start MySQL' , as a result - error 1067 (the service cannot be launched) – Mike Sep 23 '16 at 09:09
  • It works. - After almost complete cleaning contents of folder ''\xampp\mysql' from remnants of MariaDB data and new unpacking of 'mysql-5.5.52-win32.zip'. - It took me to press 'Logs' button (in XAMPP control panel) and agree with creation of correspondent file (empty btw). - After this pushing 'Start' button (for MySQL) in XAMPP control panel started MySQL. - BTW, I copied to '\xampp\mysql' two files: 'mysql_uninstallservice.bat' and 'mysql_installservice.bat' ... – Mike Sep 23 '16 at 09:44
  • Just FYI: MariaDB is a fork of MySQL and compatible to it (and I don't think they'll make it incompatible). – Charlotte Dunois Sep 25 '16 at 10:01
  • To get to the console, "run" `cmd`. _Then_ run `mysql...`. – Rick James Sep 26 '16 at 05:07
  • Don't net start mysql -- `mysqld` (not d=daemon), not mysql needs to be a _service_. – Rick James Sep 26 '16 at 05:08
  • **Did you know ?** *Oracle hasn't been growing MySQL forthcoming, but the community wants to continue doing so, so MariaDB was created as the enhanced, independent yet mostly compatible version of MySQL. So XAMPP took on the better option too. Think before change....* – Elshan Sep 20 '17 at 19:41
  • @CharlotteDunois MariaDB doesn't support some of the spatial functions that MySQL does - for example, `ST_Distance_Sphere` - and the request to add it has [gone ignored](https://jira.mariadb.org/browse/MDEV-13467) for years. Hence I need to switch, as my project involves a lot of distance calculations. – Toastrackenigma Jun 20 '19 at 04:51
  • Might be a late info, but another reason for not going for MariaDB is using MySQL Workbench. Some of its features are not MariaDB-compatible. – Richard Michael Coo Aug 07 '19 at 09:33
  • Maybe you should consider WAMPServer, if you are windows users. WAMPServer install both MySQL and mariaDB. You can then use Both or turn one off. You can also install multiple versions of PHP and MySQL and mariadb and Apache and easily switch between them with a click on a menu :) **Flexibility at last** – RiggsFolly Aug 27 '20 at 18:25

4 Answers4

71

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.
emkey08
  • 5,059
  • 3
  • 33
  • 34
  • 3
    Seriously underrated. Also, for some reasons installing xampp in a driver other than your main one (usually C:) result in a LOT of problems. You may want to reinstall in your C: drive, then redo all those steps from the very begining, this worked out for me. – N.K Nov 21 '19 at 20:54
  • Note: for me XAMPP would not launch Mysql 5.7.28. The solution was to download **32-bit** MySQL instead. Also I needed to comment `innodb_additional_mem_pool_size = 2M` in **my.ini** – Mára Toner Feb 21 '20 at 16:04
  • Perfect!! Really helpful. – Bhaumik Pandhi Jul 31 '20 at 16:53
  • 5
    Maybe you should consider WAMPServer, if you are windows users. WAMPServer install both MySQL and mariaDB. You can then use Both or turn one off. You can also install multiple versions of PHP and MySQL and mariadb and Apache and easily switch between them with a click on a menu :) **Flexibility at last** – RiggsFolly Aug 27 '20 at 18:31
  • How do I check what version of MySQL I have? (I checked but I think it's wrong: https://i.imgur.com/rEBl7NH.png) – Aditya Pratama Jan 11 '21 at 00:31
  • thanks it worked! Only one thing: the mysqld did not start so I had to replace the my.ini content file as described here: https://odan.github.io/2019/11/17/xampp-replacing-mariadb-with-mysql-8.html – Dan Jan 28 '21 at 15:52
  • 2
    follow this article for more clear instructions https://odan.github.io/2017/08/13/xampp-replacing-mariadb-with-mysql.html – Umair Feb 17 '21 at 10:39
  • 1
    Note that "command prompt" means **cmd**, **not PowerShell**. If you use PowerShell, the line `start /b bin\mysqld --log_syslog=0` will fail. – angro Sep 16 '21 at 09:43
  • linux the great forgotten and nobody explains how to make this change for linux – acgbox Oct 09 '21 at 14:30
  • These are great instructions, but how do I make sure I can use phpMyAdmin? I get a "pma@localhost is unauthorized" error. –  Jan 24 '23 at 15:09
17

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

Code
  • 1,574
  • 2
  • 23
  • 37
3

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..

ARUN Madathil
  • 896
  • 10
  • 16
2

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

Manfred
  • 990
  • 9
  • 10
  • Very easy to follow tutorial. The link has moved to to this URL: https://odan.github.io/2017/08/13/xampp-replacing-mariadb-with-mysql.html Be sure to scroll to the bottom of the article for the Known Issues before getting started. I ended up getting MySql V8 in which guide says is not compatible with Xampp. – Chason Arthur Mar 17 '19 at 13:12
  • The links on the linked github page doesn't exist any more. – Mavv3006 Aug 14 '20 at 19:06