I know the maintenance mode value used to be in the variables table, but in D8 that table is replaced by (or joined with) the config table, but I couldn't find any row with that name.
Where is it located now?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
It's no longer a part of the config system; it's a part of the state system which is stored in the
key_value table as a part of the
For Drupal 8 and 9:
First check the system.maintenance_mode value:
SELECT `value` FROM `key_value` WHERE `name` = 'system.maintenance_mode'
Then update the value:
UPDATE `key_value` SET `value` = 'b:0;' WHERE `name` = 'system.maintenance_mode' AND `value` = 'b:1;'
Then empty all tables starting with "cache":
TRUNCATE `cachetags`; TRUNCATE `cache_bootstrap`; TRUNCATE `cache_config`; TRUNCATE `cache_container`; TRUNCATE `cache_data`; TRUNCATE `cache_default`; TRUNCATE `cache_discovery`; TRUNCATE `cache_dynamic_page_cache`; TRUNCATE `cache_entity`; TRUNCATE `cache_menu`; TRUNCATE `cache_page`; TRUNCATE `cache_render`; TRUNCATE `cache_toolbar`;
An alternative (depending on your use case) is to use drush:
drush sset system.maintenance_mode 0 drush cr