The story:

Here's the full story. I disabled the Drag 'n Drop uploads module and then I was prompted to rebuild user permissions. So I was like, Ok and I rebuilt the user permissions. Then I noticed I couldn't see my admin toolbar, so I scrolled down the list of modules and it was unchecked, so was almost everything else. I went through and rechecked the modules I needed and then I clicked save. Nothing happened so I decided I'd put my site in maintenance mode until I sorted out the problem (so I did). I couldn't figure out what was wrong or how to fix it so I restored my entire website from a backup made earlier (1:28 AM) today but now it's giving me an error and I can't even access my site.

The Error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.role' doesn't exist: SELECT r.rid, r.name, ur.uid FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid IN (:uids_0); Array ( [:uids_0] => 0 ) in UserController->attachLoad() (line 314 of ...public_html/modules/user/user.module).

The question:

Is there any way to fix this error?

  • As a side note, make sure your server isn't out of disk space (or nearly out). MySQL does really weird things when this happens.
    – mpdonadio
    Jul 8, 2012 at 2:06

1 Answer 1


It sounds like the roles database table got randomly deleted, which should basically never happen under the circumstances you describe.

If you have a recent database backup, I suggest you grab the structure and content of the roles table from that database backup and restore that to your site database so you have the right content.

If you don't have a backup, I suggest you do a new installation on a separate site (or your local computer) and then export JUST the roles table from that new installation and import the roles.

  • As it turns out, the client I was using to restore my Db was horrible so I had to do it by hand. Just copied it from Notepad++ into phpMyAdmin, worked like a charm. Thanks! Jul 8, 2012 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.