You are hereBlogs / vinayras's blog / Error: Table 'watchdog' was not locked with LOCK TABLES

Error: Table 'watchdog' was not locked with LOCK TABLES


vinayras's picture

By vinayras - Posted on 29 February 2008

Hi All,

Error:

Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, ......

I have shared database environment. Database is shared using $db_prefix in settings.php for each sub-domains.

Due to some changes, one of the sub-domains started giving this error. I tried searching for this in Google and Drupal.org support forums. Most of the answers were related to MySQL 4.0 and LOCK TABLE permissions issue. This did not help me since - i have granted all permissions to user accessing this database.

Finally after much testing many solutions, i found that the problem was in settings.php of that sub-domain itself.

While sharing database, one needs to make sure that follwing tables are NOT shared

-> cache_content
-> watchdog

Each sub-domain should use their own set of these tables.

With these changes my system is again working fine.

Please have a look at http://www.ebharat.in. We have 35 sub-domains (and growing) using same database with shared tables for sharing users, contents and so on.

Regards
Vinay Yadav
http://www.vinayras.com

No votes yet
Anonymous's picture

Dear Vinay, I have a similar error message, while I want to use a webform. I've found your blog in Google, when I've had searched for the problem. I'm a beginner! How can I share (or not) the database table? I have no cpanel, only phpmyadmin (and drupal 6.2, ubuntu 8.04, apache...)

Thanks for your kind answer!

Regards,
Laszlo Landi

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
16 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.