系统版本osx 10.10.4
将下面的代码加入到bash或者zsh配置文件即可
sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql
# Use MAMP version of PHP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH