Can't start MySql, port 3306 busy

允我心安 提交于 2019-12-01 03:04:17

问题


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?

Thanks!


回答1:


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



回答2:


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.



回答3:


Just Open task manager and Kill MySql service.




回答4:


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.




回答5:


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 3306

Hope this may help someone!




回答6:


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 3307




回答7:


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


来源:https://stackoverflow.com/questions/6136389/cant-start-mysql-port-3306-busy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!