Can't start MySQL, port 3306 busy

Just Open task manager and Kill MySql service.


In a command shell, run:

netstat -b -p TCP

or

netstat -an | grep -i listen | grep -E 3306

The first command will output a list that you will need to look through for the line that displays localhost:3306 in the second column. Below this is the application's name using the port.

The secondary command will find find the exact port you are looking for and looks something like this:

<example-name>:user <example-name>$ netstat -an | grep -i listen | grep -E 3306
tcp46      0      0  *.3306                 *.*                    LISTEN

I had the same problem and was stuck on this thing for a day and I couldn't find a perfect answer anywhere. So I gave it a shot on my own and it worked. This solution is for Windows users. I use Windows 7.

My xampp control panel was displaying an error that port 3306 is busy and in use by some file (name was specified).. say "filename.de".

Now follow the following steps:

  1. press Ctrl+Alt+Del and open Task Manager.
  2. Open the "Processes" list and Check for "show all processes" under the list of processes. If you don't see any such option, don't worry! as sometimes administrator permission is required to show some processes.
  3. Now, when you click on "show all processes" button, all the process will be displayed.
  4. Now, switch to "services" tab in the task manager, and a list of services will be displayed. Now look for a service named "filename.de" <-- filename that was diplayed in the error message in xampp.
  5. When you find that service, 'right-click', and then click in option.. GoTo Process.
  6. You will be redirected to the "Processes" tab with focus on a process corresponding to that service. 'Right-Click' and then click on "end process tree".
  7. Now, the issue has been solved! But might have to do the same thing again when you restart your PC. So it is best to keep your PC in sleep-mode.
  8. Otherwise, to solve this issue permanently, open "msconfig" and uncheck that particular process from the services list and click on apply. and you can restart your system.