netstat -tln mysql 1

netstat -tln mysql

lsof -n -P -i TCP -s TCP:LISTEN

Here is what the above code is Doing:
1. lsof -n -P -i TCP -s TCP:LISTEN
-n: Don’t resolve hostnames
-P: Don’t resolve port names
-i: Specify the network interface
-s: Specify the protocol
TCP:LISTEN: Only show TCP ports that are listening

Similar Posts