Get out of maintenance mode using database query (without using drush or admin area)
It's never the best idea to manipulate the database directly (for the usual reasons), but if you're out of other options, it's not that unsafe:

UPDATE key_value 
SET value = '&lt;value&gt;' 
WHERE collection = 'state' 
AND name = 'system.maintenance_mode'


Where &lt;value&gt; is replaced with a serialised PHP string representing the integer value 1 for enabled, or 0 for disabled, e.g.

$value = serialize(1);


You'll probably want to invoke a cache rebuild after manually updating the variable, it's probably cached somewhere.