Disable drupal modules using MySQL query

Sometimes, you may want to disable or enable drupal modules using mysql queries. In my case, it has happened when disabling a module during peak traffic hours. I can not afford to disable a module from standard interface, since, it rebuilds menu_router bringing load to the database server.

Connect to your mysql shell and then use following shell query to disable a module:

UPDATE system SET status=0 WHERE name='module';

To list all drupal modules:

SELECT * FROM system WHERE type='module';

Post your Answer

  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Links to specified hosts will have a rel="nofollow" added to them.

More information about formatting options