Can't start MySQL, port 3306 busy (ok)

https://stackoverflow.com/questions/6136389/cant-start-mysql-port-3306-busy#:~:text=Press%20Ctrl%20%2B%20F%20and%20write,%2C%20namely%20%22%20End%20Task%20%22.

102

I'm trying to start MySQL from XAMPP (under Windows Vista), but it's saying that's port 3306 is busy.

What would be the best way with check what application is using that port and how to free it?mysqlwindowsxamppShareFollowedited Sep 18 '20 at 12:53Dharman21.6k1818 gold badges5757 silver badges107107 bronze badgesasked May 26 '11 at 9:27Roger6,1471919 gold badges5555 silver badges8686 bronze badges

Add a comment

11 Answers

ActiveOldestVotes9

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

ShareFollowedited Jan 17 '19 at 6:24JaysQubeXon5,32733 gold badges1111 silver badges1515 bronze badgesanswered May 26 '11 at 9:33Linus Kleen31.2k1111 gold badges8484 silver badges9696 bronze badges

Add a commentReport this ad12

Just Open task manager and Kill MySql service.ShareFollowanswered Nov 25 '14 at 14:36asas12111 silver badge22 bronze badgesAdd a comment5

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.

ShareFollowedited Aug 18 '13 at 19:42Nev1,4022020 silver badges1818 bronze badgesanswered Aug 18 '13 at 19:09Prabhat5111 silver badge55 bronze badgesAdd a comment5

As Mentioned By @Segun Emmanuel Run the Following Command:

netstat -a -b 

You will get a list of Applications that are using different PORTS. Press Ctrl + F and write 3306 to find out which Application is using PORT 3306.

enter image description here

After this, Go to Task Manager via Search Bar or by pressing CTRL + ALT + DEL. Then Under the Background Processes, find out mysqld.exe, right-click on it and you will find an option to close it, namely "End Task".

enter image description here

Then go to your Xampp Control Panel and start the MySQL service.

enter image description hereShareFollowedited Mar 28 '20 at 12:47answered Mar 28 '20 at 6:19Kashif Iftikhar99077 silver badges2323 bronze badges

  • 1This worked like a charm! thanks a lot. I was trying to install the MySQL DB via the MySQL installer & encountered this issue on windows 10. I had to open the CMD in admin mode & execute the given command, found the culprit who was still dwelling on 3306 & killed him as you suggested. The MySQL MSI installer was blocked due to the 3306 port already in use issue. It got resolved as soon as I killed the mysqld.exe process from the 'Services' tab list. Yas! +1 Thanks. – Aniket Mar 24 at 15:14

Add a comment3

If mysql is not starting in xampp, it might be a port conflict issue. Mysql run by default on port 3306. you need to check if another application is occupying that port. use following command to check app occupying a port

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

if you find an application occupying that port, stop the application and restart xampp. As an alternative, you can go to php.ini file or click configure in the xampp for mysql and change the mysql port to 3307ShareFollowanswered Mar 9 '19 at 12:35ABODE61011 gold badge1111 silver badges1111 bronze badgesAdd a comment2

In my case it was javaw.exe which was starting on port 3306. This exe does not cause problem if I am logged in using single user in my Windows 10. But if I have multiple logins, it starts this exe for each user and blocks MySQL to start on 3306 port.

Going to task manager and killing this exe for the other user fixed the issue and MySQl could start.ShareFollowanswered Aug 18 '17 at 11:29Mihir Kagrana33122 silver badges44 bronze badgesAdd a comment2

Windows icon -> Open cmd.exe. Type netstat -a -b. Find what's using it. In my case it was this: Image 1

So, I went to task manager. There were no process called so. The I went to services and disabled these two:

Image 2

Now everything works fine.ShareFollowedited Apr 14 '20 at 14:12Azametzin4,3321212 gold badges2222 silver badges3737 bronze badgesanswered Apr 14 '20 at 13:20naglis mockevicius2122 bronze badgesAdd a comment1

I had this problem (slight variation as I was using MAMP)

I found this problem was due to having MySQL Workbench installed, MySQL Workbench started the mySQL service on bootup which in turn stopped MAMP being able to use the port.

To fix this I had 2 options,

  1. Uninstall MySQL Workbench

  2. Open Task, click services tab, kill the current MySQL service

This then allowed MAMP to use port 3306ShareFollowedited Sep 18 '20 at 12:52Dharman21.6k1818 gold badges5757 silver badges107107 bronze badgesanswered May 10 '16 at 13:36AndrewBramwell47411 gold badge77 silver badges2626 bronze badgesAdd a comment1

I've been having trouble for hours on this error. I was trying to run MySQL from XAMPP after quite some time. It gave errors, similar to yours, it said that port 3306 is in use. If you:

  • are running on Windows 10

  • are avoiding to change the port number of MySQL from 3306

  • can't see any program using the 3306 port from netstat

  • reinstalling and deleting everything yet it still give the same error

  • are enabling and using Hyper-V

  • all of the other solutions didn't work

This is the solution that worked for me:

  • Go to the most right of the taskbar and right-click the connection icon, click Open Network & Internet settings

  • Click Change adapter options

  • Right-click and Disable everything that relates to Hyper-V

I ran MySQL again at now it works.ShareFollowanswered Jan 11 at 12:36rareguy1122 bronze badgesAdd a comment0

For this problem, a simpler way on Windows is:-

  1. Go to Task Manager

  2. Go to Services

  3. There will be a services named MySQl80 right click on it and then select "Stop"

  4. Try and start the MySQl module on XAMPP server again

ShareFollowedited Jul 19 '19 at 7:54Darren Taylor1,6021212 silver badges1818 bronze badgesanswered Jul 19 '19 at 7:22rohit kumar ranjan1Add a comment0

If you where not able to find any application or process listening on port 3306, you might need to check your network adapters.

  • Disable adapters you do not use.

  • Pay also attention to the Hyper-V generated network adapter, disable it if you don't need it. Sometimes it can reserve some ports and commands like netstat will not be able to find it out

Last updated

Was this helpful?