check which port on which mysql is running in mac using lsof code example Example: how to check the port of mysql installation in mac lsof -n -P -i TCP -s TCP:LISTEN