Friday, July 8, 2011

Access Denied for All Users

I recently encountered a problem logging in. I could log in as the admin or any other user, but it would show the "Access Denied" message instead of the admin controls. The site worked fine for anonymous users, but no one could log in to make changes.

I have found that when there are server issues, such as a power failure, and the Drupal site is not functioning properly when it is back up, the first place to check is the MySQL database. You can quickly identify tables that are in need of repair by looking for tables that display "in use" instead of the table information.

I used phpMyAdmin to take a look at the database. Viewing the database structure, the accesslog and sessions tables were "in use" and in need of repair. I clicked on the SQL tab and ran two different SQL commands:

  1. repair table accesslog;
  2. repair table sessions;

Once both tables were successfully repaired, users were able to log in to the site again.

1 comment: