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';

Learn: Mysql string replace.