Drush CC all returning "No Drupal site found, only 'drush' cache was cleared" I've tried other solutions, but none of them are specific to my setup. I just started using the new Linux subsystem featured in the recent Windows 10 update. I'm using WAMP x64 v3.0.6, and have successfully cloned my website and got it up and running. At the root of the Linux subsystem, I installed Drush globally with Composer, using the directions given on the Drupal webapage.

Typing drush status returns the following when I run it in my default directory:

Drupal version         :  7.50
 Site URI               :  http://default
 Database driver        :  mysql
 Database hostname      :  localhost
 Database port          :
 Database username      :  root
 Database name          :  aerosphere
 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php5/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /home/bob/.composer/vendor/drush/drush/drush.php
 Drush version          :  7.1.0
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  /mnt/c/wamp64/www/drupal-7.50
 Site path              :  sites/default


But, as mentioned in the title, drush cc all returns No Drupal site found, only 'drush' cache was cleared.[warning] I assume it has something to do with adding a path to the .bashrc, but I don't know what to add. Any tips would be greatly appreciated!

My question is different from "Drush - No Drupal Site Found when clearing cache", they're on a Mac and using MAMP, and I'm using WAMP on Windows. I've tried the solutions offered on that post, but the issue has not been resolved.

I'm obviously having issues connecting to MySQL as I get this when I run mysql command:


  The program 'mysql' can be found in the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtradb-cluster-client-5.5
  
  Try: sudo apt-get install .


So I've added these lines to my .bashrc file:

PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="/mnt/c/wamp64/mysql/mysql5.7.14/bin:$PATH"


The top line was added to get drush working. I've checked multiple times, and I have the path correctly set, but it's still not working.
There are a few things you can do to help debug your drush. Here is what you can try:

Debug output

Use drush cc all -vvv

This will provide you with some valuable information in terms of what Drush is doing in the background and maybe show you the actual error message.

Check your settings.php

Depending on your setup you may be passing in environment variables to your settings.php file for a database configuration for instance. Or perhaps to provide memcache. Drush unfortunately does not pick these up as it's bypassing apache. Therefore I would give it a test run without environment variables to see if that eliminates the issue or help narrow it down. For debug purposes it may be worth just using a clean copy from the example.settings.php and just modifying the database array to test this.

Check the mysql client is available

This is one that tripped me up a while ago and the drush -vvv will point you in the right direction. If it can read the settings.php, which it appears it seems to be able to as it gets the db settings, then perhaps it can't connect to your mysql database. One of the issues I had was that mysql client command was not available. E.g. try calling 'mysql' and see if that works. After fixing that it worked. In my Mamp setup it was just a matter of ensuring the correct path to the executable was in my shell $PATH.

I hope this helps.