5

This question already has an answer here:

I installed drush using composer following the instructions here: http://docs.drush.org/en/master/install/

When trying to run drush cc all I get this error:

No Drupal site found, only 'drush' cache was cleared.[warning] 'all' cache was cleared. [success]

I added this line:

export PATH="/Applications/MAMP/bin/php/php5.6.2/bin:$PATH"

to my .bash_profile and restarted bash and MAMP. Still no luck. Any ideas?

This is my drush status:

 Drupal version         :  7.36                                                             
 Site URI               :  http://default                                                   
 Database driver        :  mysql                                                            
 Database hostname      :  localhost                                                        
 Database port          :                                                                   
 Database username      :  root                                                             
 Database name          :  srod                                                   
 PHP executable         :  /usr/bin/php                                                     
 PHP configuration      :                                                                   
 PHP OS                 :  Darwin                                                           
 Drush script           :  /Users/srod/.composer/vendor/drush/drush/drush.php 
 Drush version          :  7.0-dev                                                          
 Drush temp directory   :  /tmp                                                             
 Drush configuration    :                                                                   
 Drush alias files      :                                                                   
 Drupal root            :  /Applications/MAMP/htdocs/srodsite                           
 Site path              :  sites/default   

I'm running it from Drupal project folder.

marked as duplicate by kenorb, Pierre.Vriens, Shawn Conn, Adrian Cid Almaguer, No Sssweat Mar 25 '16 at 0:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You run it from inside your drupal project folder, right? – leymannx May 6 '15 at 17:31
  • Yes, running it from drupal project folder. – srodrig May 6 '15 at 17:34
  • Please post the output of drush status, if all is correctly set up it should be giving you the appropriate database name. This is usually the case when incorrect values in settings.php – pal4life May 6 '15 at 17:55
  • Added my drush status in my original post – srodrig May 6 '15 at 18:38
  • I can't seem to update the PHP executable... does this have something to do with the issue? – srodrig May 6 '15 at 21:07
2

I figured out that you will need a mysql server installed and included in path, even if you are using mysql from AWS RDS.

  • This seems sadly correct but it shouldn't be that way – frazras Apr 15 '16 at 3:37
  • Thanks for this! I have a Drupal installation where I'm using an RDS instance and didn't bother installing mysql on the server itself. Luckily I found your answer quite quickly and didn't spend too much time running around in circles. The error drush outputs doesn't make any sense. – Titi Sep 8 '16 at 22:36
2

For people working on Windows, you need to verify that your PATH Variable for MYSQL is properly set. I had the problem when I had upgraded my WAMP.

Example like this : C:\wamp\bin\mysql\mysql5.6.17\bin

  • It's worked for me. I realize the error was from sql once I execute command drush sql-cli and it's return error unrecognized mysql command – Praditha May 15 '18 at 3:59
0

Haven't tried it myself, but maybe you want to try what is mentioned here , and which points to https://www.drupal.org/node/1428638 . Here is a quote from it:

Edit the settings.php file of your drupal installation, and go to the database settings entry.

change the host line to:

'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',

Curious to hear if that could help ...

0

If you're running inside Drupal root folder, there are two possibilities which may go wrong:

  1. drush cannot find Drupal core files (you don't have index.php or common.inc), check by:

    find -maxdepth 2 -name index.php -o -name common.inc
    
  2. Your PHP CLI doesn't have PDO extension (php -m | grep pdo).

  • So how do we fix these things? – JBeck Oct 31 '17 at 18:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.