I created a website in drupal 7, tested it in my localhost and works good. Now, I want to host the site in our Main server. So, I uploaded the site directory to the server and created a corresponding database for that. Updated the settings.php file with the database name, user and password.

I do hope that the site install process is done. The site is deployed within the server, database created. When I give the address of the site, it shows some PDO exception error.

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 167 of /home/cpath/D-6.12/apache2/htdocs/[htdocs]/includes/lock.inc).

I tried re-installing the drupal site, it didn't work.

I even reviewed and tried all the solutions shown in drupal.org, but no way I couldn't resolve the issue.

I appreciate your valuable suggestions.

  • This question is duplicate. I already answered this in here. this is because of your database engine which must be converted to MyISAM from InnoDB. go to that link for more detail.
    – M a m a D
    Jun 11, 2014 at 15:48
  • try running update.php [your-site]/update.php
    – shrish
    Jun 11, 2014 at 15:53
  • I have gone through this post, but didn't dare to try it. Are you sure it works???
    – GIRI
    Jun 11, 2014 at 15:54
  • yes be sure. 98% of my website was completed and suddenly the same error reported. it took about one week to find the solution. just take a look at the comment below my answer. it worked for that guy too
    – M a m a D
    Jun 11, 2014 at 15:55
  • update.php didn't work, same PDO exception error. But now the error was updated, [database].system does not exist 'code' in drupal_get_installed_schema_version() (line 155 of /home/cpath/D-6.12/apache2/htdocs/sehs/includes/install.inc). 'code'
    – GIRI
    Jun 11, 2014 at 15:56

2 Answers 2


Changing the database engine wont help. What you should understand is what is drupal semaphores. follow this link: https://www.drupal.org/project/flood_sem if you want to understand what semaphores are. In you case it means this table of semaphores which drupal depends on does not exist due to your misconfiguration during migrate or install. You will have to run drupal install script.

However, semaphores tables dont run on innoDB but myISAM since its a PHP process that calls a third party service for data like drupal theme forms, theme tables ect.

I hope u understand.


I ran into this same error message in moving Drupal 7 from one development site to another development site on my laptop. Upon checking the tables in the Drupal database I found that the full sql dump was not being imported (using Adminer and the "From server" option, adminer.sql).

Look for Drupal 7 database tables that come near the end of the dump alphabetically like: user*, views*, webform*, workbench*, xmlsitemap* to see if it all imported.

I then used drush sql-cli < database.sql to import the sql dump into the Drupal database after dropping all tables with drush sql-drop.

  • Please don't double post answer across multiple questions. As the answer states, this is a duplicate question that should be flagged as such.
    – Shawn Conn
    Oct 13, 2016 at 18:14
  • Sorry, I would have posted a comment and linked to the answer on the other issue but since I do not have 50 points I cannot. Oct 13, 2016 at 18:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.