If one have mysql workbench installed you can access mysql or mysqldump command from there like:
/Applications/MySQLWorkbench.app/Contents/MacOS/mysql -u <USER> -p<PASS> -h 127.0.0.1 --execute="SELECT 1"