Drush not working on Multisite with Shared User Table I have a Drupal 7 Multisite Environment with sub-directories.

(E.g):


mainsite.com
mainsite.com/multisite1
mainsite.com/multisite2
mainsite.com/multisite3
etc.


Each website has its own Database and all are on the same Database Server

I recently configured the multisites to have a Shared User table along with a few shared custom User fields and that aspect works.

However, I am now unable to use Drush within the Multiste directories.

Previously, I would CD into the directory and be able to run Drush commands for that specific multisite like this:

cd /var/www/mainsite.com/sites/multisite1
drush cc all


Now it tells me that "No Drupal site found".

When I comment out the prefix portion of my settings.php file, Drush works again.

How can I make Drush work for these sites?

Below is what my settings.php file looks like:

$databases['default']['default'] = array(
  'driver' =&gt; 'mysql',
  'database' =&gt; '[Multisite DB]',
  'username' =&gt; '[Database Username]',
  'password' =&gt; '[Database Password]',
  'host' =&gt; '[DB Server IP]',
  'charset' =&gt; 'utf8mb4',
  'collation' =&gt; 'utf8mb4_general_ci',
  'prefix' =&gt; array(
        'default'   =&gt; '[Multisite DB].',
        'users'     =&gt; '[Main Site DB].',
        'sessions'  =&gt; '[Main Site DB].',
        'role'      =&gt; '[Main Site DB].',
        'authmap'   =&gt; '[Main Site DB].',
        'users_roles'   =&gt; '[Main Site DB].',
        'field_data_field_first_name'   =&gt; '[Main Site DB].',
        'field_data_field_last_name'   =&gt; '[Main Site DB].',
        'field_data_field_title'   =&gt; '[Main Site DB].',
  ),
);
The solution ended up being very simple.

I just had to change one line.

I changed this:

        'default'   =&gt; '[Multisite DB].',


to:

        'default'   =&gt; '',


This is how it looks all together.

$databases['default']['default'] = array(
  'driver' =&gt; 'mysql',
  'database' =&gt; '[Multisite DB]',
  'username' =&gt; '[Database Username]',
  'password' =&gt; '[Database Password]',
  'host' =&gt; '[DB Server IP]',
  'charset' =&gt; 'utf8mb4',
  'collation' =&gt; 'utf8mb4_general_ci',
  'prefix' =&gt; array(
        'default'   =&gt; '',
        'users'     =&gt; '[Main Site DB].',
        'sessions'  =&gt; '[Main Site DB].',
        'role'      =&gt; '[Main Site DB].',
        'authmap'   =&gt; '[Main Site DB].',
        'users_roles'   =&gt; '[Main Site DB].',
        'field_data_field_first_name'   =&gt; '[Main Site DB].',
        'field_data_field_last_name'   =&gt; '[Main Site DB].',
        'field_data_field_title'   =&gt; '[Main Site DB].',
  ),
);


I know that a lot of people use Bakery or are already on Drupal 8, but I hope this helps anyone still on Drupal 7 looking to share a User table across multiple websites with different databases.