Last Updated: February 25, 2016
·
490
· walidvb

Drush on MAMP 3.x / site-install

Add this line to your ~/.profile or ~/.bash_profile:

alias drush='DRUSH_PHP=/Applications/MAMP/bin/php/php5.3.28/bin/php /usr/local/Cellar/drush/6.2.0/bin/drush'

modifying your drush and php path if needed.

Then, if you want to boost up your drush with a one liner site install and set-up, you need to set up MAMP's mysql:
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

Last, create a drushsi.sh file in your $PATH, with the following

mysql -u username --password=yourpassword -e 'CREATE DATABASE $1;'
drush site-install standard --db-url=mysql://username:yourpassword@localhost/$1 --site-name=$1 --account-name=your_drupal_username --account-pass=your_drupal_password

I'll try and update this to have more functionnality, and eventually come up with a drush plugin. let's see

Thanks to http://nic-o.com for the help