Thanks for sharing your vote !
Have a minute to tell us and other readers how this question helped you? We feature review like yours in our Recommended Review section.
Please let me know that how to fix the XAMPP error “MySQL Shutdown Unexpectedly” in windows 11. I am facing these issues while running Windows 11. Help me.
Level 11008 Point Active 2 days ago
Are you bothered because MySQL is not running or is shutting down unexpectedly? If yes then you must apply the troubleshooting solutions to fix this issue. The troubleshooting process may differ based on the local environment you are using.
This process is quite simple with XAMPP as you can use the control panel instead of using the command line.
Usually, one shuts down MYSQL database software manually. When the software shuts down unexpectedly, you are not able to connect to the database. This means WordPress is not going to work. In order to fix this error, take a good look at the different solutions mentioned below.
Below mentioned are the different ways that you can apply to fix the XAMPP error.
Usually, XAMPP error appears when you run your software using administrative privileges. This happens because the components fail to function properly at low permission levels. In case you are not sure whether that is the cause of the problem or not, you must restart the environment as an administrator. If you wish to do this in Windows, search for the folder where you installed XAMPP. After that, right-click on the XAMPP file and run it as administrator.
In case you are a Mac user, right-click on the folder and then choose the Get Info option. Now, a pop-up window will open up before you. There, you need to go to the section of "Sharing & Permissions". Select the padlock icon and then enter the administrator password. After that, Change the Read and Write permission settings to "Everyone". Once your open XAMPP and its every component is working, MYSQL should work properly.
In case launching XAMPP with administrative privileges does not fix your problem, then you must restore the backup. XAMPP creates a backup for the software of your environment. You can access this backup in the folder where you installed the software.
By default, you will see XAMPP MySQL backup files under Local Disk, XAMPP, MySQL. In this directory, you are going to see various folders, two of these folders are backup and data. This folder contains every file that your database uses. The backup folder has the recent copy of your MySQL.
You must stop the MySQL software from the control panel before you restore the backup files. This can easily be done by going to the main menu and selecting the stop button right next to the MySQL option. After that, go back to your XAMPP folder. To restore the backup, rename the data folder and then change the name of the backup folder.
MySQL shutdown unexpectedly error can also appear if some other software is using the MySQL assigned port. It is 3306 by default. To be sure, you need to choose the Ntestat module from XAMPP's control panel that is above the Shell tool.
Netstat is a command-line tool that displays active connections on the network. It also displays the ports that you are using. After you initialize Netstat, you can see which port every tool in your stack is using, including MySQL.
In case any conflict with the port leads to the shutdown, running MySQL with admin privileges or restoring a backup is not going to change anything. The only thing that can help you resolve this issue is to change the port that MySQL is using.
To do this, you can use the same process that we displayed in the previous section. After that, go to XAMPP's main menu and select the config button. After that, select my.ini option. This file has MySQL configuration settings. Once you click on it, XAMPP will open the file using the default text editor.
Once you get there, search for the line that says Port. This specifies the port number that MySQL is using. Now, change the port number to the option that is not used by other programs.
It is a PHP development environment that you can use for Linux, Mac, and Windows. It is a collection of software that allows you to host websites locally. This environment allows you to install the software that you require to run WordPress locally using one bundle only instead of setting up every element individually.
XAMPP has many components such as Perl, PHP, MariaDB, and Apache. Apart from setting up the software, you must run WordPress. XAMPP will provide you with a simple control panel. This will allow you to access logs for XAMPP's components. It has an overview log that displays everything that is happening in the background of your environment.