troubleshooting Drush bootstrap on localhost
Troubleshooting the "Drush was not able to start (bootstrap) the Drupal database." when trying to run in on a localhost configuration.
Many thanks to Chris Wells from Redfin Solutions for this troubleshooting tip on getting drush to work in a localhost configuration.
In the settings.php file, try changing
$db_url = 'mysqli://username@localhost/example';
$db_prefix = '';
to
$db_url = 'mysqli://username@127.0.0.1/example';
$db_prefix = '';
comment #12 http://drupal.org/node/502252
"... I tried running "drush sql cli" (or use the command from "drush sql connect") and see if it connects. I was having a problem with MySQL not connecting (ergo, it can't connect to the DB do Drush reports that it's not highly-enough bootstrapped).
For me, the problem was that the settings.php command string had "localhost" as the server. MySQL will try and connect through a socket if the host is localhost; for me, sockets were disabled..."
Comments
Fixes my drush bootstrap error mesage
Great. This fixed my drush bootstrap error message on localhost.
I was getting the following error message after executing the drush command, drush statusmodules. (Hopefully it will work (fix) in the same way with other drush command as well.)
Full text of the error message is as follows:
Command statusmodules needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command.
The command 'drush.php sm' could not be executed.
Seems like a drush issue that needs to be fixed, and localhost should be an accepted alias for 127.0.0.1.
Thanks again!