cola
cola

Reputation: 12466

Drupal Installation PDOException

http://localhost got problem:

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

This is my database configuration:

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'database' => 'drupal_test',
      'username' => 'root',
      'password' => 'XXX',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

What to do?

Upvotes: 3

Views: 14952

Answers (5)

Guray Celik
Guray Celik

Reputation: 1281

This problem is related to your mysql database type. If you are moving your site another server, probably your database type is mismatch and using InnoDB. Because of that, you have to change your database table's type with this command.

ALTER TABLE **table_name** ENGINE = MyISAM;

Upvotes: 0

alexvance
alexvance

Reputation: 1124

This just happened to me. I manually added database information to settings.php and tried to run the install script by accessing http://localhost/mysubdirectory, instead of adding db info through the install script. Drupal saw the db information and thought it was installed, so it looked for its Drupal tables, couldn't find them, and threw the error.

The solution for me was simply to run the script manually (navigating to http://localhost/mysubdirectory/install.php). Hope this helps!

Upvotes: 10

Nikit
Nikit

Reputation: 5128

semaphore is core table for holding semaphores, locks, flags, etc. that cannot be stored as Drupal variables since they must not be cached. In some version updating (6.xx-6.yy) it was lost, so just create it:

CREATE TABLE IF NOT EXISTS `semaphore` (
  `name` varchar(255) NOT NULL DEFAULT '',
  `value` varchar(255) NOT NULL DEFAULT '',
  `expire` double NOT NULL,
  PRIMARY KEY (`name`),
  KEY `expire` (`expire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Upvotes: 1

Pablo Morales
Pablo Morales

Reputation: 717

It try to read a table was not found.

If you install a new module, try to reinstall this module, or remove it . But if you don't install anything, you need to reinstall all drupal :(

Upvotes: 0

srchulo
srchulo

Reputation: 5203

a lot of times simply uninstalling and trying again can fix bugs like this. It's possible that there was something wrong with the installation of maybe you gave it some incorrect information.

Upvotes: 4

Related Questions