Drush problem on fresh one-click Drupal

Posted March 13, 2016 6.2k views
DrupalDigitalOcean 1-Click Apps Marketplace


I navigate to the Drupal folder an run: drush up

And get this error
Command pm-update needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to [error]
run this command.
The drush command ‘up’ could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]

  • drush status reports everything correctly
  • i can connect to mysql via cli

I’ve read somewhere that if cli/php.ini and fpm/php.ini are in different places, drush won’t work but I can’t see exactly why. Any help?

  • I am having the same problem, I tried renaming .my.cnf out of the way as suggested below, but nothing changed.

  • I also have this problem on a fresh Drupal drop.


    Running drush with the --debug flag shows the following error:

    Executing: mysql --defaults-extra-file=/tmp/drush_N5fNzx --database=drupal --host=localhost --silent  < /tmp/drush_5yzlr6
      ERROR 1045 (28000): Access denied for user 'drupal'@'localhost' (using password: YES)

    However, I am able to connect to the database on localhost with the username/password combo from the settings.php:

    mysql -u drupal -p
    Enter password:

    I have also tried adjusting the privileges for the drupal user on the drupal database:

    # mysql -u root
    mysql> grant all privileges on drupal.* to drupal@localhost;
    Query OK, 0 rows affected (0.00 sec)


    After reading the suggestions below, renaming the root user .my.conf file with the following command resolved the issue:

    mv /root/.my.conf /root/.my.conf.backup

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

I figure the problem out.

Drush db connection is superseded by the .my.cnf located in the /root folder that allows the root user direct connection to mysql.

However since drush tries to connect to drupal@localhost that has a different password, it fails with Access denied for user ‘drupal’@'localhost’.

Moving .my.cnf out of the way solves the problem.

It seems to me, better to add line
into the /root/.my.cnf file instead of renaming it. This will allow you to be able both update drupal and login to mysql cli without typing password.

  • this is an excellent solution.
    Renaming the .my.cnf file prevented me from administering mysql at the command line.
    Adding user=root right above the password line in /root/.my.cnf solved both issues.