首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用drush站点-安装删除表并在MAMP中重新安装

无法使用drush站点-安装删除表并在MAMP中重新安装
EN

Drupal用户
提问于 2015-04-11 02:10:12
回答 1查看 497关注 0票数 0

我有一个运行MamP3.0.7.3的本地多站点实例,如果不首先删除数据库,我就不能使用drush site-install命令重新安装我的一个站点。

如果在不删除数据库的情况下尝试命令,则会得到以下输出:

代码语言:javascript
复制
$ 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 />

在尝试导入SQL文件时,我也遇到了同样的问题,方法是执行类似于drush sql-dropdrush sqlc < path/to/file.sql的操作,这是我在很多博客文章中建议的模式。

我正在使用Drush 6.5安装通过作曲家。我的同事也有类似的配置,没有这个问题。

EN

回答 1

Drupal用户

发布于 2015-04-11 09:57:36

确保没有任何东西中断Drush调用;尝试一个drush cc all来查看错误是否仍然出现,并调试它是否仍然出现。

为了避免删除数据库,简单的“黑客”回答是:

  1. 编辑站点的settings.php文件以使用另一个数据库方案(确保它存在)。$databases = =>数组( 'example1‘=>数组( 'example1’=> 'example2‘),//更改为"example1“。‘用户名’‘=> 'user',’密码‘’=> 'pass',),);
  2. 使用site-instal。这将删除"Example2“,并在不损害原始数据库的情况下在那里安装站点。
  3. 将站点的配置文件编辑回原始数据库方案。

您需要在"drush sqlc“部分使用反引号:``drush sql-connect`` < path/to/file.sql

票数 1
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/154715

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档