I've done some research and found several places where people suggest using netstat
to check which port a particular process is using.
But here is what I got:
myMac:~/Documents$ netstat -ap tcp | grep -i "listen"
tcp4 0 0 localhost.mysql *.* LISTEN
What does localhost.mysql
say about the port number?? I'm expecting a 4 digit number like 3306.
Any thoughts?
You should use -n for netstat to show network addresses as numbers.
netstat -nap tcp | grep -i "listen"
man netstat
-n Show network addresses as numbers (normally netstat interprets addresses and attempts to display them symbolically). This option may be used with any of the display formats.
Or use lsof:
lsof -n -P -i TCP -s TCP:LISTEN
Or use mysql client to check mysql port:
mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With