I don't have access to the backend and need to disable all the modules. How can I disable them via database?
This really depends.
In cases you just want to hide your module output it is enough to go to Magento admin
System \ Advanced \ Advanced and disable your module output there.
In case you want to disable your module completely you will need a file access but even then you may get some surprises. Some modules are almost impossible to disable completely :-)
First and easiest way is to set
<active>false</active> in your module bootstrap file.
However this will not eliminate your classes if some other modules are extending them. Deleting module files is also not an option as you will still need to remove extension declarations to avoid fatal errors. Also as Petar mention in comments if your extension is implementing custom backen model or something like this and there's also some entities relying on this model deleting extension files will again result in fatal error(s).
Additionally deleting files is not removing any database entries extension created during execution of install/update scripts and/or extension's functionality.
By using this Query you can find all the Modules:-
SELECT * FROM `core_config_data` WHERE `path` LIKE '%modules_disable_output%`;
For Enable the Modules just run this Query:-
UPDATE `core_config_data` SET `value` = 0 WHERE `core_config_data`.`path` LIKE '%modules_disable_output%';
For Disable the Modules just run this Query:-
UPDATE `core_config_data` SET `value` = 1 WHERE `core_config_data`.`path` LIKE '%modules_disable_output%';
path is your module path in
This is not possible. You can disable module output - which is not the same as disabling the module entirely. Observers still fire, etc. The only thing suppressed is block output.
For a bit of an explanation from @fooman, see the video below.
Fooman explains in the video that the module itself is still enabled, but the output on the frontend is suppressed.
If block output disabling is all you need, the relavent code would be in
core_config_data and can be accessed via the following method:
So flip this value to 1 (true) to disable.