Skip to content

Instantly share code, notes, and snippets.

@codethereforam
Created June 12, 2024 08:02
Show Gist options
  • Select an option

  • Save codethereforam/c31bd8931efe92d89eb63b84b30f0a51 to your computer and use it in GitHub Desktop.

Select an option

Save codethereforam/c31bd8931efe92d89eb63b84b30f0a51 to your computer and use it in GitHub Desktop.
Windows查找占用3306端口的应用

在Windows系统中,你可以使用 netstat 命令和 findstr 命令来查找哪个进程正在使用特定的端口。以下是如何查找哪个进程正在使用3306端口:

打开命令提示符(cmd),然后输入以下命令:

netstat -ano | findstr 3306

这将显示使用3306端口的所有连接,以及这些连接的进程ID(PID)。输出将类似于以下内容:

TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING       1234

在这个例子中,进程ID是1234。

然后,你可以使用 tasklist 命令来查找这个进程ID对应的进程名:

tasklist | findstr 1234

将1234替换为你在上一步中找到的进程ID。这将显示进程ID对应的进程名,这就是正在使用3306端口的进程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment