Port 3306 is in use by "Unable to open process"!

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
  1. Using Command Prompt.
    1. Open Command Prompt as administrator.
    2. Type following command: (Assuming port is 3306)
      • netstat -aon | findstr :3306 and press Enter.
        Ashwith's Blogs
    3. As you can see in above, currently the port 3306 is being used by process with process id(pid) 6308.
    4. Now to kill above task, type the following command:
      • taskkill /F /pid 6308 and press Enter.
        Ashwith's Blogs
    5. This will kill the process 6308 and will Solve the problem.
  2. Manually Stopping the Service
    1. Press Windows Key + R. It will open Run.
    2. Type service.msc and click OK.
    3. It will open Services window, with list of running services.
    4. Search MySQL80 in the service list.
    5. Right click on the service and click Stop.
      Ashwith's Blogs
    6. This will Stop the service running on port 3306 and will solve the problem.