Just created a new Drupal 8 install using ddev, however, I'm having issues with drush. Whenever I run the command drush cr
it returns the error:
[error] SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
If I run the command drush en admin_toolbar
with the --debug
flag it returns the error:
Executing: mysql --defaults-file=/private/tmp/drush_ty1hL4 --database=db --host=db --port=3306 --silent < /private/tmp/drush_OSFtCb
ERROR 2005 (HY000): Unknown MySQL server host 'db' (0)
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command pm:enable was not found. Drush was unable to query the database.
The only solutions I was able to find in regards to this issue was changing host
in settings.php from localhost
to 127.0.0.1
but since the settings.php file was generated by ddev during configuration, host
is actually db
and changing it to anything causes the site to break.