My Drupal site has been up and running for about 4 years now on D6. I've regularly been updating the modules every month or so. Recently, I found that I could not log into the site. It gave the following error:
Warning: Table 'database.permission' doesn't exist query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN (1) in .../includes/database.mysqli.inc on line 169
I logged into the mySQL DB via phpmyAdmin to find that the entire permission table have been deleted completely. Not sure how it happened. Don't think my DB has been hacked as the password is quite long and difficult to brute force hack.
I foolishly tried upgrading the site to 6.28, hoping that that might somehow fix the broken tables. Unfortunately, now I have the same error as above, with the addition of another one stating that the sessions tables are also missing. phpMyAdmin confirms this.
What I've tried so far:
1. I first made a backup of my site and DB in its current state. Unfortunately, I never installed 'Backup and Migrate' so I don't have any DB backups form before.
2. I tried exporting the access and sessions tables from another D6 site and importing them in, hoping that would fix it. Now the site works ok for visitors, but the moment anyone tries to log in, I get the following error: