欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal7 PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7study.drupal7semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 16

shiping1 的头像

我的原因是 数据库中好像没有表

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7study.drupal7semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of D:\xampputf8\htdocs\drupal7study\includes\lock.inc).

 

 

Community Documentation

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '[database].semaphore' doesn't exist ... in lock_may_be_available()

Last updated June 9, 2012. Created by Heine on October 13, 2011.
Edited by shahin1986. Log in to edit this page.

Symptoms

Accessing the site's URL does not result in a page or a redirect to the installer, but you are greeted by this error instead:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '[database].semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 164 of C:\www\core7\includes\lock.inc).

Causes & Solutions

The ultimate source of this error is that the table semaphore doesn't exist in the database.

Manually edited settings.php before running the installer

Adding the database data to settings.php makes Drupal "believe" it is already installed.

Solution: Do not edit settings.php manually; please follow the steps in INSTALL.txt.

In most cases you cannot rescue the install by visiting install.php, as the installation will now abort with the error

Table variable already exists.

To solve this, discard your manually edited settings.php file, empty the database, then follow the steps in INSTALL.txt.

The database has been emptied or the table semaphore has been removed

Solution: Restore the database from backup.

Comments

the same problem with drupal 7.19

the error was caused by the settings.php that i created

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbName_semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/user/public_html/includes/lock.inc).
I deleted it
Refreshed and the installation process started
the installation auto-created the settings.php

I ran into the same error. I

I ran into the same error. I am using Acquia Dev Desktop and imported a site to a dev machine as localhost7 to be accessed locally as http://localhost7. Somehow in drupal "sites" directory i got both "default" and "localhost7" directories containing the same set of files. And that confuses drupal. Once I removed "sites/localhost7" this issue is gone. ^^

 

来自 https://drupal.org/node/1308308

 

普通分类: