Base table missing in database? I just emptied the cache in my Drupal database via MySQL, and all of a sudden I'm getting this error on my home page? Help! How can I fix this? It almost seems like a table was deleted by accident?

Original


  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146
  Table &#039;databasename.entity_test_type&#039; doesn&#039;t exist:
  SELECT et.* FROM {entity_test_type} et; Array ( ) in
  entity_test_entity_info() (line 73 of
  /var/www/drupal/true-001/sites/all/modules/contrib/entity/tests/entity_test.module).


Additional


  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146
  Table &#039;databasename.locales_source&#039; doesn&#039;t exist:
  SELECT lid, location FROM {locales_source} WHERE source = :source AND
  context = :context AND textgroup = &#039;default&#039;; Array (
  [:source] =&gt; An AJAX HTTP error occurred. [:context] =&gt; ) in
  _locale_parse_js_file() (line 1563 of /var/www/drupal/true-001/docroot/includes/locale.inc).
Yes that is correct, the errors are saying entity_test_type and locales_source do not exists. Try searching for them with PHPMyAdmin or any other DB viewer and you will very likely not find them. So yes, somehow those tables got deleted or possibly renamed? 


  Help! How can I fix this?


If they got deleted, you have the following options:

A) Disable and uninstall those modules, then enable them again and they should create the missing tables.

B) Revert back to a DB backup where those tables exist, then export the 2 tables only. Now revert back to your latest DB backup where they are missing and just import those 2 tables. 

C) Manually re-create those tables with the proper column names