Skip to content

Instantly share code, notes, and snippets.

@odan
Last active June 4, 2023 19:44
Show Gist options
  • Save odan/c799417460470c3776ffa8adce57eece to your computer and use it in GitHub Desktop.
Save odan/c799417460470c3776ffa8adce57eece to your computer and use it in GitHub Desktop.
XAMPP - Replacing MariaDB with MySQL

XAMPP - Replacing MariaDB with MySQL

This post has been deleted.

@0x10Ayoub
Copy link

if you have this problem Access denied for user 'pma'@'localhost' (using password: NO) you can solve it by going to:
1:C:\xampp\phpMyAdmin\config.inc.php
2:search for /* User for advanced features */
3:change pma to root or your username $cfg['Servers'][$i]['controluser'] = 'root'; sorry for my english

@trd-alkein
Copy link

mysqld --initialize-insecure
mysqld: Can't create directory '/usr/local/mysql-5.7.21-macos10.13-x86_64/data/' (Errcode: 17 - File exists)
2018-02-28T09:18:27.033487Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-02-28T09:18:27.237097Z 0 [ERROR] Aborting

@sdbrown67
Copy link

Has anybody figured out how to get the stop button working. I even tried "net stop mysql" and couldn't find any service is Windows services. All I could do was shut down the PC and restart it. With errors while shutting down.

@odan
Copy link
Author

odan commented Mar 2, 2018

@sdbrown67 I just simplified the whole process. Please Update to the latest XAMPP version and try it again. Due to permission problems, the XAMPP control panel could cause problems. This script helped me: https://gist.github.com/odan/eb6dd532a59956f4ae9b1216fa842271

@Arcyfa
Copy link

Arcyfa commented Mar 30, 2018

While executing mysql_upgrade.exe -u root -p I got error mysql_upgrade: [ERROR] 1136: Column count doesn't match value count at row 1.
This was solved by adding --force to the upgrade command.
mysql_upgrade.exe -u root -p --force

@maneeshaindrachapa
Copy link

maneeshaindrachapa commented Apr 26, 2018

To stop the mysql service in windows, you can open xampp control panel in administrative mode and stop the mysql service
capture

@devshark
Copy link

11:57:11 AM [mysql] Error: MySQL shutdown unexpectedly.
11:57:11 AM [mysql] This may be due to a blocked port, missing dependencies,
11:57:11 AM [mysql] improper privileges, a crash, or a shutdown by another method.
11:57:11 AM [mysql] Press the Logs button to view error logs and check
11:57:11 AM [mysql] the Windows Event Viewer for more clues
11:57:11 AM [mysql] If you need more help, copy and post this
11:57:11 AM [mysql] entire log window on the forums

Does this guide implicitly requires that you have admin privileges before performing? If not, please help because I cannot start my MySQL service after performing the steps above. I got stuck at

Start the MySQL server. You can use the XAMPP Control Panel (MySQL > Start) to start the MySQL service.

I do not need to migrate old data from MariaDB.

@CreateWithCoding
Copy link

CreateWithCoding commented May 6, 2018

I fixed by copying the data directory from mariadb to mysql. I didn't need the old databases so I didn't copy at first. but there must be some things in that mariadb/data that is needed. Anyway it works now it appears.

The reason I changed over to MySQL by Oracle is because MySQL Workbench wouldn't work with MariaDB. I've been using MySQL Workbench for years and love it. I wasn't quite so impressed with MariaDB Workbench looking at it earlier today.

Same error as @devshark above

Error: MySQL shutdown unexpectedly.
7:52:43 PM [mysql] This may be due to a blocked port, missing dependencies,
7:52:43 PM [mysql] improper privileges, a crash, or a shutdown by another method.
7:52:43 PM [mysql] Press the Logs button to view error logs and check
7:52:43 PM [mysql] the Windows Event Viewer for more clues
7:52:43 PM [mysql] If you need more help, copy and post this
7:52:43 PM [mysql] entire log window on the forums

Thanks for putting this together @odan

@CreateWithCoding
Copy link

ah still not working. MySQL Workbench not liking it. screenshot below ...

image

@aymenbz
Copy link

aymenbz commented May 11, 2018

thank you so much

@odan
Copy link
Author

odan commented May 21, 2018

@yiiprogrammer @devshark

You can create a fresh data directory with this command:

cd c:\xampp\mysql
c:\xampp\mysql>bin\mysqld.exe --initialize-insecure --basedir=c:\xampp\mysql --datadir=c:\xampp\mysql\data

@EoghanH
Copy link

EoghanH commented May 24, 2018

May be useful to include a link to https://github.com/phpmyadmin/phpmyadmin/blob/master/sql/create_tables.sql

If the user decides against importing their old data, their phpmyadmin will break unless they run the above script :)

@addylov89
Copy link

I think you miss one folder (\bin) on the route
Create a new file: c:\xampp\mysql\my.ini and copy this content:

It should be
Create a new file: c:\xampp\mysql\bin\my.ini and copy this content:

@akaki1991
Copy link

I cant start mysql from xampp

@odan
Copy link
Author

odan commented Jul 24, 2018

@akaki1991

Make sure you have installed the 32-bit version of MySQL. The 64-bit version is not compatible with the XAMPP Control Panel.

@eemaano
Copy link

eemaano commented Aug 3, 2018

my.ini needs to be in /bin unlike original instructions - otherwise works
thanks @addylov89 for pointing that out

@cleitonoliveira
Copy link

Thank you for the tut, it helped me a lot. About the start/stop issue, @addylov89 solves it.

@projinitech
Copy link

Worked like charm. Replaced MariaDB 10.1.34 with MySQL 5.6.41.
Now MySQL Workbench works well with MySQL on XAMPP.
Thanks

@altrusl
Copy link

altrusl commented Sep 5, 2018

my.ini should be in the bin directory

@weratad
Copy link

weratad commented Sep 14, 2018

Yes move my.ini should be in the bin directory
Work now

@JustinDraude
Copy link

Worked like a charm. Cheers guys. my.ini does need to be in the bin directory, indeed.

@eyalroth
Copy link

eyalroth commented Mar 2, 2019

The MySQL server should be restarted after the mysql_upgrade.exe command, otherwise there might be errors.

See: https://stackoverflow.com/questions/6288103/native-table-performance-schema-has-the-wrong-structure

@Jakhongir91
Copy link

Is it possible to do the same for mac OS?

@Gegeenmedia
Copy link

Hello @odan, i faced mysqld.exe - System error.

The code execution cannot proceed because msvcr120.dll was not found. Reinstalling the program may fix this problem.
Please help me.

Thank you.

@bornemisza
Copy link

@akaki1991

Make sure you have installed the 32-bit version of MySQL. The 64-bit version is not compatible with the XAMPP Control Panel.

Worst news :(
Btw, would be great to see in the https://odan.github.io/2019/11/17/xampp-replacing-mariadb-with-mysql-8.html description
This answer sold my problem 👍

@loyison
Copy link

loyison commented Feb 27, 2020

I have followed all the steps its still not working,

The code execution cannot proceed because msvcr120.dll was not found. Reinstalling the program may fix this problem.

installed the 32 bit updated my.ini

@odan
Copy link
Author

odan commented Feb 27, 2020

@loyison The file MSVCR120.dll should be part of the Microsoft Visual C++ 2013 Redistributable Package

https://www.microsoft.com/en-us/download/details.aspx?id=40784

@michaelprankl99
Copy link

Links aren't working anymore

@enigmaelectronica
Copy link

Bad... The links are broken... maybe Takedown?

@odan
Copy link
Author

odan commented Oct 1, 2020

@enigmaelectronica Sorry, the page has been deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment