Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

this is a popular error in drupal that you guys might have seen this before :

PDOException: SQLSTATE[42S02]: Base table or view not found, table .... does not exist.

when I'm trying to install drupal7, it reports an error that semaphore table does not exist. I tried to create it manually by this query

CREATE TABLE IF NOT EXISTS `semaphore` (
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique name.',
  `value` varchar(255) NOT NULL DEFAULT '' COMMENT 'A value for the semaphore.',
  `expire` double NOT NULL COMMENT 'A Unix timestamp with microseconds indicating when the semaphore should expire.',
  PRIMARY KEY (`name`),
  KEY `value` (`value`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table for holding semaphores, locks, flags, etc. that...';

it reported the same error. I changed InnoDB to myISAM and it worked!!! I found out that tables with the InnoDB engine are not supported in mysql on the server and unfortunately drupal7 creates all the tables with this engine by default. is there any way to change this default to MyISAM ?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The schema definitions can take an argument of 'mysql_engine', which defaults to 'InnoDB', in createTableSql().

In theory you could thus alter all the defined schemas with a custom module, and change the engine.

It's highly questionable to do so though. If you value your site and data, you should NOT use MyISAM unless you understand the difference the two engines.

Switch to a provider that supports InnoDB instead. MySQL itself defaults to InnoDB as of 5.5. I would be very suspicious of any provider that didn't support InnoDB.

share|improve this answer
    
from performance perspective InnoDB seems to be superior to MyISAM, but when the whole website is down because of engine-type, performance does not matter at all –  Drupalist Jan 1 at 12:45
1  
@Mohammad but MyISAM is more likely to malfunct in a way that would take your website down. –  Mołot Jan 1 at 13:43
    
@Mołot you are right but what can I do when website doesn't work with InnoDB? I would be happy if it worked with InnoDB but even the localhost reports the above mentioned error. –  Drupalist Jan 1 at 14:13
1  
@Mohammad I am not sure if Drupal 7 will work properly with MyISAM. InnoDB is ACID compliant, while MyISAM isn't. You may need to dig around to see if Drupal 7 database transactions will still work reliably. –  MPD Jan 1 at 15:26
1  
@Mohammad if your code is trying to access tables in some obsolete way, you fix the code, not downgrade server. –  Mołot Jan 1 at 22:38

Try this way: (from here: https://www.drupal.org/node/1089724 )

In includes>database>mysql>shema.inc, on line 84, I changed 'mysql_engine' => 'InnoDB' to 'mysql_engine' => 'MyISAM'.

It works for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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