Cannot start MySql, port 3306 is busy

I am trying to start MySql from XAMPP (under Windows Vista), but it says that port 3306 is busy.

What would be the best way to check which application uses this port and how to free it?

Thanks!

+6
source share
7 answers

In a command shell, run:

netstat -b -p TCP 

or

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

The first command will display a list that you will need to view for the row that displays localhost:3306 in the second column. Below is the name of the application using the port.

The secondary command will find the port you need and will look something like this:

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

I had the same problem and got stuck on this thing for a day and I couldn't find the perfect answer anywhere. So I did it on my own and it worked. This solution is intended for Windows users. I am using Windows 7.

My xampp control panel showed an error that port 3306 was busy and used by some file (the name was specified) .. say "filename.de".

Now follow these steps:

  • press Ctrl + Alt + Del and open the task manager.
  • Open the "Processes" list and check "show all processes" in the process list. If you do not see such an option, do not worry! since sometimes administrator permission is required to resolve some processes.
  • Now, when you click the "show all processes" button, the entire process will be displayed.
  • Now go to the "services" tab in the task manager and a list of services will be displayed. Now find the service with the name "filename.de" <- filename that was populated in the xampp error message.
  • When you find this service, right-click and select .. GoTo Process.
  • You will be redirected to the Processes tab with a focus on the process corresponding to this service. Right-click, and then click End of Process Tree.
  • Now the problem is solved! But you may have to repeat the same thing when you restart your computer. Therefore, it is better to keep the computer in sleep mode.
  • Otherwise, to solve this problem forever, open "msconfig" and remove this specific process from the list of services and click "Apply." and you can reboot the system.
+5
source

Open the task manager and start the MySql service.

+4
source

In my case, it was javaw.exe, which started from port 3306. This exe does not cause problems if I am registered using one user in my Windows 10. But if I have several logins, it starts this exe for each user and blocks MySQL to run on port 3306.

Switching to the task manager and destroying this exe for another user fixes the problem, and MySQl can start.

+2
source

I had this problem (slight change when I used MAMP)

I found that this problem is due to the fact that MySQL Workbench is installed, MySQL Workbench started the mySQL service at boot, which in turn stopped using MAMP in port usage.

To fix this, I had 2 options,

  • Remove MySQL Workbench
  • Open the task, click the services tab, kill the current MySQL service

This allowed MAMP to use port 3306.

Hope this helps someone!

+1
source

If mysql does not start in xampp, this could be a port conflict issue. Mysql starts by default on port 3306. You need to check to see if another application is using this port. use the following command to test the application occupying the port

 Linux: netstat -tulpn | grep 3306 Window: netstat -a -b Mac: lsof -nP -i4TCP:3306 

if you find an application occupying this port, stop the application and restart xampp. Alternatively, you can go to the php.ini file or click "configure" in xampp for mysql and change the mysql port to 3307.

0
source

For this problem, an easier way on Windows is:

Step 1. Go to the task manager. Step 2. Go to services. Step 3. Services with the name MySQl80, right-click, select "Stop" and try to start the MySQl module on the XAMPP server again.

0
source

Source: https://habr.com/ru/post/889091/


All Articles