How to get MySQL's port on Mac through the terminal?
If you have turned on Apache on your Mac and also enabled PHP, you can run the phpinfo() command which will give you tons of information such as:



Based on what I've read, 3306 is the default, so if you didn't specifically change it, then it's probably that.

You can also use MySQL Workbench from Oracle. When I launch it, it shows: