How to Fix the XAMPP Error “MySQL Shutdown Unexpectedly” in windows 11?

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.

Aves

  0 2 months ago 1 Ans 2521 Views Windows 11
Reply
Answer Link
Open Answer 05 September 2022

Fix the XAMPP Error “MySQL Shutdown Unexpectedly” in Windows 11:

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.

What is XAMPP Error MYSQL Shut Down Unexpectedly? 

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. 

Different Ways to Fix the XAMPP Error "MySQL Shutdown Unexpectedly

Below mentioned are the different ways that you can apply to fix the XAMPP error. 

Solution 1: Use Administrative Privileges to Run XAMPP

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. 

Solution 2: Restart Your Database Backup

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. 

Solution 3: Change the MySQL Port

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.

What is XAMPP?

 

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.

Write your answer for "How to Fix the XAMPP Error “MySQL Shutdown Unexpectedly” in windows 11?"

Tymal boult

Member Joined 3 years ago

Level 1 Active 2 hours ago

Chat with
Technical
Experts