Install Drupal with Drush on a Mac with MAMP

Submitted by Peter Majmesku on Thu, 02/08/2018 - 18:16

On MAMP use must specify the "unix_socket" key in your settings.php file databases array, to install Drupal. The quickest way to install Drupal is via a console tool like Drush. Make sure you have copied your default.settings.php file to settings.php. Make sure your databases array looks like so:

$databases['default']['default'] = array (
'database' => 'my_database',
'username' => 'root',
'password' => 'root',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

Afterwards execute the "drush si" command. See below.

peter@computer my-site $ drush si
You are about to DROP all tables in your 'my_database' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option. [ok]
Installation complete. User name: admin User password: Znf3JkksyW [ok]
Congratulations, you installed Drupal! [status]
peter@computer my-site $

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.