netstat -apn|grep 3306


netstat :  用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接
-a, --all :  显示所有套接字(默认 : 已连接)
-p, --programs :   显示套接字的 PID/程序名称
-n, --numeric :   不要解析名称
grep :  用于查找文件里符合条件的字符串


tcp        0      0  *               LISTEN      2067/docker-proxy
tcp6       0      0 :::3306                 :::*                    LISTEN      2071/docker-proxy
Was this helpful?

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.