Port 3306 is in use by "Unable to open process"!
26 November 2022
Error
MySQL shut down unexpectedly.
Reasons
- This may be due:
- Blocked port
- Missing dependencies
- Improper privileges
- A crash, or a shutdown by another method.
- Most commonly, it is due to a blocked port, as some other process might be running at the same time on the same port.
Solutions
There are two ways to solve it:
- Using Command Prompt
- Manually Stopping the service
- Using Command Prompt.
- Open Command Prompt as administrator.
- Type following command: (Assuming port is 3306)
netstat -aon | findstr :3306
and press Enter.
- As you can see in above, currently the port 3306 is being used by process with process id(pid) 6308.
- Now to kill above task, type the following command:
taskkill /F /pid 6308
and press Enter.
- This will kill the process 6308 and will Solve the problem.
- Manually Stopping the Service
- Press Windows Key + R. It will open Run.
- Type
service.msc
and click OK. - It will open Services window, with list of running services.
- Search MySQL80 in the service list.
- Right click on the service and click Stop.
- This will Stop the service running on port 3306 and will solve the problem.