Can't use drush site-install to drop tables and reinstall in MAMP I have a local multisite instance running MAMP 3.0.7.3, and I can't use the drush site-install command to do a re-install of one of my sites without actually dropping the database first.

If I try the command without dropping the database, I get the following output:

$ drush --uri="www.example.local" si -y my_great_install_profile --account-pass=admin --sites-subdir="www.example.com"
You are about to DROP all tables in your 'example_site' database. Do you want to continue? (y/n): y
&lt;h1&gt;Additional uncaught exception thrown while handling exception.&lt;/h1&gt;&lt;h2&gt;Original&lt;/h2&gt;&lt;p&gt;PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &amp;amp;#039;example_site.registry&amp;amp;#039; doesn&amp;amp;#039;t exist: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array
(
    [:name] =&amp;amp;gt; drush_drupal_site_install
    [:type] =&amp;amp;gt; interface
)
 in _registry_check_code() (line 3188 of /Users/gravelpot/sites/www.example.local/includes/bootstrap.inc).&lt;/p&gt;&lt;h2&gt;Additional&lt;/h2&gt;&lt;p&gt;PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &amp;amp;#039;example_site.registry&amp;amp;#039; doesn&amp;amp;#039;t exist: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array
(
    [:name] =&amp;amp;gt; drush_drupal_environment
    [:type] =&amp;amp;gt; interface
)
 in _registry_check_code() (line 3188 of /Users/gravelpot/sites/www.example.local/includes/bootstrap.inc).&lt;/p&gt;&lt;hr /&gt;Drush command terminated abnormally due to an unrecoverable error.                                                                            [error]
&lt;h1&gt;Uncaught exception thrown in shutdown function.&lt;/h1&gt;&lt;p&gt;PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &amp;amp;#039;example_site.semaphore&amp;amp;#039; doesn&amp;amp;#039;t exist: DELETE FROM {semaphore}
WHERE  (value = :db_condition_placeholder_0) ; Array
(
    [:db_condition_placeholder_0] =&amp;amp;gt; 1731533568552880e6a71ed3.80394544
)
 in lock_release_all() (line 269 of /Users/gravelpot/sites/www.example.local/includes/lock.inc).&lt;/p&gt;&lt;hr /&gt;


I also have the same problem when trying to import a SQL dump file by doing something like drush sql-drop followed by drush sqlc &lt; path/to/file.sql, which is a pattern I see suggested in a lot of blog posts.

I am using Drush 6.5 installed via composer. My co-workers have a similar configuration, and do not have this problem.
Make sure nothing breaks Drush calls; attempt a drush cc all to see if the error still appears, and debug if it does.

To avoid dropping the database, the simple "hacked" answer is:


Edit site's settings.php file to use another database scheme (make sure it exists though).

$databases = array (
  'example1' =&gt; 
  array (
    'example1' =&gt; array (
      'database' =&gt; 'example2', // Changed from "example1".
      'username' =&gt; 'user',
      'password' =&gt; 'pass',
    ),
  ),
);

Use site-instal . This will drop "Example2" and install the site there, without hurting the original database.
Edit the site's configuration file back to original database scheme.


You need to use backquotes on the "drush sqlc" part:``drush sql-connect`` &lt; path/to/file.sql.