大家好,又见面了,我是你们的朋友全栈君。
在调试服务或者程序的时候我们经常会通过检测对应端口是否打开来判断服务是否成功启动,本例就拿mysql的3306来实验。
再看看3306端口是否已经被占用
一、查看端口占用
netstat -aon|findstr “3306”
二、查看id对应的程序
tasklist|findstr “6572”
==============================
C:\Users\Administrator>netstat -aon|findstr “3306”
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1948
TCP 192.168.1.129:53333 192.168.0.200:3306 ESTABLISHED 7480
TCP 192.168.26.1:54305 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54306 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54340 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54341 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54342 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54343 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54344 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54345 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54468 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54469 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54470 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54471 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54791 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54792 192.168.26.128:3306 ESTABLISHED 6572
TCP 192.168.26.1:54859 192.168.26.129:3306 ESTABLISHED 6572
TCP 192.168.26.1:54860 192.168.26.128:3306 ESTABLISHED 6572
C:\Users\Administrator>tasklist|findstr “6572”
java.exe 6572 Console 1 300,288 K
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/144360.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...