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
<h1>Additional uncaught exception thrown while handling exception.</h1><h2>Original</h2><p>PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &#039;example_site.registry&#039; doesn&#039;t exist: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array
(
[:name] =&gt; drush_drupal_site_install
[:type] =&gt; interface
)
in _registry_check_code() (line 3188 of /Users/gravelpot/sites/www.example.local/includes/bootstrap.inc).</p><h2>Additional</h2><p>PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &#039;example_site.registry&#039; doesn&#039;t exist: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array
(
[:name] =&gt; drush_drupal_environment
[:type] =&gt; interface
)
in _registry_check_code() (line 3188 of /Users/gravelpot/sites/www.example.local/includes/bootstrap.inc).</p><hr />Drush command terminated abnormally due to an unrecoverable error. [error]
<h1>Uncaught exception thrown in shutdown function.</h1><p>PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &#039;example_site.semaphore&#039; doesn&#039;t exist: DELETE FROM {semaphore}
WHERE (value = :db_condition_placeholder_0) ; Array
(
[:db_condition_placeholder_0] =&gt; 1731533568552880e6a71ed3.80394544
)
in lock_release_all() (line 269 of /Users/gravelpot/sites/www.example.local/includes/lock.inc).</p><hr />
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 < 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.