Fixing Drupal’s anonymous user access denied problem

I run several Drupal-based websites, and today one of them stopped allowing unregistered users access to new content, for seemingly no reason. One solution I found was to upgrade from v5.6 (which I was running) to v5.7, but that didn’t work.

It turns out there’s a really simple fix that worked for me. I just ran the following SQL command:

INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);

I renamed “node_access” to include the Drupal table prefix (you may not have one), and of course I backed everything up beforehand, but it worked.

Why? Well, it seems that user ID “0″ (that is, “anonymous user”) had gone walkabout from the database table. Where it went, I don’t know, but that command restores it. As always, your mileage may vary.

Leave a Comment

Filed under computers, howto

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>