Centos下查看占用端口并关闭进程方法

1.查看端口占用情况:netstat –tlnp   (加p可以看到是哪个进程占用了端口);

也可以用grep查找对应的被占用的端口,键入netstat –tlnp | grep 3306可以看到PID为1771

2.关闭进程:键入kill 1771即可杀死mysqld进程,然后键入netstat –tlnp |grep 3306发现,这个进程没有在运行了。

原文地址:https://www.cnblogs.com/Yemilice/p/6202645.html