My data base is not right. I can't log in as Admin nor request a new password with the site in maintenance mode. Where in the database does Drupal store the state of maintenance mode? I need to take my site out of maintenance mode before I can request a new password to log in.

Thanks

Rich

Comments

nancydru’s picture

http://www.example.com/?q=user. Yes, it's "user" NOT your user id. That will take you to a log in screen.

Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Site Design Notes

rl’s picture

Please read my post carefully. I can't log in. There is a problem with my data base. I can log in if I can get to the page where I can reset my password. I can't get their while in maintenance mode.

Rich

hectorplus’s picture

All you have to do is log in as user 1, go to the maintenance page to disable the off-site mode. That's the easy way, rather than figure out what database Drupal uses.

If you are having problems loggin in, you mite want to empty the sessions and the cache tables. Not DELETE! Empty them.

hectorplus’s picture

Ok, if you have access to phpmyadmin, empty the sessions table and then go to http://www.example.com/?q=user, you will get the login/request pass link.

nancydru’s picture

You can login with this method even when in maintenance mode - as a matter of fact you HAVE to do it this way.

This is also how you get in if you disable the user login block.

Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Site Design Notes

thetsp’s picture

Thanks Nancy.
You helped me.

drupalnewbie85225’s picture

Thanks for the info.

deeinus’s picture

Yay!! Thanks to your tip, I was able to reconnect.

pyutaros’s picture

Rich,
I'm sorry nobody here was willing to answer the ACTUAL question you asked. Drupal stores the maintenance mode setting in the variable table in a row labeled site_offline. The values for status are s:1:"0" for online and s:1:"1" for offline. See this thread for additional info. http://drupal.org/node/125170
Thanks,
Jonathan
Drupal's so easy, even I could do it.
http://www.kfol.org/

idcm’s picture

Hi pyutaros - so glad you caught the issue. Now I am hoping you can take things a little further. What does one do if changing the database variable does not work. I have used the strategy you describe above on other sites and it works but I am faced with something strange. For some reason, the site still thinks it is in maintenance mode. I have emptied the cache and the session (just for grins) but no luck.

FYI, i manually set clean urls but that is ignored as well.

thoughts?
c

earthangelconsulting’s picture

from http://drupal.org/node/56995

UPDATE variable SET value = 's:1:"0";' WHERE name= 'site_offline';
DELETE FROM cache WHERE cid = 'variables';

in other words, updating the row in the "variable" table isn't enough, because that table has been serialized and cached in the "cache" table... you must do the 2nd statement too!

i just verified this myself, in a similar emergency situation.

Peter 'Fish' Fisera
http://earthangelconsulting.com

sunnyq’s picture

Thanks, goatvirus. I was on the brink of giving up when I found your comment. Once I excuted the second statement to clear the cache, I could access my content again. YAY! Now on to fixing the rest of my problems... Thanks again! :) Cheers, -SunnyQ

freescholar’s picture

I totally forgot about the second line DELETE FROM cache WHERE cid = 'variables';

You saved me! Thanks.

Give a Drupal

idcm’s picture

I forgot to update this. If my memory serves, my issue turned out to be Mollom. The Mollom keys weren't set up before the site started having issues. I manually created the Mollom records using another site as a reference.

corbin’s picture

thanks !!!

variable table in a row labeled site_offline. The values for status are s:1:"0" for online and s:1:"1" for offline

http://drupal.org/comment/reply/124562/233659#comment-233659

CC

nickrice’s picture

If your are really stuck you can do the following in addition to UPDATE variable and deleting from cache as described above, if that still leaves your login page saying the site is offline.

1. Edit index.php and comment out the full "if (is_int($return))" statement, leaving only the line "print theme('page', $return);"

2. You should now be able to log in the normal way.

3. Then comment the above lines back in and fix whatever got you into the mess in the first place!

webmaster-eddie’s picture

To take your site out of or put it into Maintenance Mode via the database, go to the variable table of the correct database for your domain.com, and: *** this is for drupal 7.15 ***

Use phpmyadmin - (enter a SQL command via the field under the SQL tab) or mysql in ssh and issue the following commands:

To put site Into maintanance mode:
UPDATE `variable` SET `value`='1' WHERE 'name' = 'maintenance_mode'

Change 'value' to '0' to take site out of maintenance mode

To allow you as admin to use site in maintenance mode:
UPDATE `variable` SET `value`='your.IP.address.here' WHERE 'name' = 'skip_maintenance_mode_by_ip_ip'
(..._ip_ip is not a typo, and you must substitute your actual IP address of your internet connection for your desktop computer for the value, above)

Then clear your caches twice.

----------------------------------------------------------------------------------

To turn maintenance mode on or off with ftp or sftp or ssh from the settings.php file of your domain.com :

near the end of the file change, or add this line if it isn't there (or remove the ';' before the line to uncomment it):

to turn off maintenance mode:
$conf['maintenance_mode'] = FALSE;

change to TRUE to turn on maintenance mode

then clear your caches twice and update the database

drupalnesia’s picture