MySQL on XAMPP fails to start almost every time I have to reboot my machine. There are several answers on StackOverflow that say I must copy the backup folder after backing the data folder up, and that solves it, for sure, but only until the next time my machine reboots.
The fact that this "backup" folder exists in the XAMPP installation (or maybe it exists in all MySQL installations?) indicates to me that this is a known issue, because if the issue did not exist, the folder would not be necessary.
But what I do not know is how to prevent this crash in the first place. This happens whether I shutdown my Windows 11 machine normally, whether it crashes, whether I stop the service before shutting down, it does not matter. It still fails to restart MySQL on XAMPP at least 70% of the times.
Is there something I can do to prevent this from happening in the first place?
Thanks in advance!
I use Xampp 5.6 and Xampp 8.1.7 and, since I replaced the native "mysql" installed (in fact, MariaDB) with a fresh install of MySQL, I haven't had crashes anymore.
I followed these instructions: https://ourcodeworld.com/articles/read/1215/how-to-use-mysql-5-7-instead-of-mariadb-in-xampp-for-windows, which are related to MySQL Community. However, I believe that they will also serve to do a fresh installation of MariaDB, if you prefer.
It is also necessary to create a dedicated user for phpMyAdmin, called "pma". It can be done via phpMyAdmin itself or via MySQL CLI, as follows:
CREATE USER 'pma'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'pma'@'%' WITH GRANT OPTION;
After this fresh install, you can use the my.ini file that came with Xampp, but you must edit it to eliminate deprecated directives (or directives with bad values). Example: "key_buffer" directive must be renamed to "key_buffer_size", otherwise MySQL Community will crash; innodb_additional_mem_pool_size is deprecated and will crash on MySQL Community version 5.7.44; max_allowed_packet=1M is terribly low and must be set to the default value of 64.