我有一个运行MamP3.0.7.3的本地多站点实例,如果不首先删除数据库,我就不能使用drush site-install命令重新安装我的一个站点。
如果在不删除数据库的情况下尝试命令,则会得到以下输出:
$ 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 'example_site.registry' doesn't exist: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array
(
[:name] => drush_drupal_site_install
[:type] => 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 'example_site.registry' doesn't exist: SELECT filename FROM {registry} WHERE name = :name AND type = :type; Array
(
[:name] => drush_drupal_environment
[:type] => 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 'example_site.semaphore' doesn't exist: DELETE FROM {semaphore}
WHERE (value = :db_condition_placeholder_0) ; Array
(
[:db_condition_placeholder_0] => 1731533568552880e6a71ed3.80394544
)
in lock_release_all() (line 269 of /Users/gravelpot/sites/www.example.local/includes/lock.inc).</p><hr />在尝试导入SQL文件时,我也遇到了同样的问题,方法是执行类似于drush sql-drop和drush sqlc < path/to/file.sql的操作,这是我在很多博客文章中建议的模式。
我正在使用Drush 6.5安装通过作曲家。我的同事也有类似的配置,没有这个问题。
发布于 2015-04-11 09:57:36
确保没有任何东西中断Drush调用;尝试一个drush cc all来查看错误是否仍然出现,并调试它是否仍然出现。
为了避免删除数据库,简单的“黑客”回答是:
site-instal。这将删除"Example2“,并在不损害原始数据库的情况下在那里安装站点。您需要在"drush sqlc“部分使用反引号:``drush sql-connect`` < path/to/file.sql。
https://drupal.stackexchange.com/questions/154715
复制相似问题