So not thinking I reinstalled WAMP without looking into backup or migration of the php database I was using for my site. I still have my site folder and phpmyadmin still shows my database in the list but I'm getting

PDOException: SQLSTATE[42S02]: Base table or view not found

This error occurs when I try the old database or when I try a newly made one during installation steps.

Yes it was dumb. Any way to save it?

Comments

Stefan Lehmann’s picture

Definitely first backup your database through PHPMyadmin. Then doublecheck in the settings.php, if there are already database credentials set. You might have to change them directly in that file - not sure how that could have happened though.

I like cookies!

rwhitake’s picture

No this is either a problem with PHP, my PHP database, or MySQL (i think). The settings didn't change and I hadn't even hardened the site from default passwords because it's just for dev.

Stefan Lehmann’s picture

Does the error message say anything else, eg. which table it is not finding?

I like cookies!

rwhitake’s picture

Here's the full message from loading the site as it was.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sitename.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of C:\wamp\www\www.sitename.com\includes\lock.inc).

and here is the other error when i reset to default settings and attempt the installation steps again.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sitename.variable' doesn't exist

Stefan Lehmann’s picture

So that simply means that Drupal is looking for a DB called "sitename" and that there are probably no tables in the database yet.

Did you check if the database "sitename" does exist and that these tables "semaphore" & "variable" are listed in the database?

I like cookies!

rwhitake’s picture

In phpMyAdmin when I click any entry in the pre-existing database it returns 1146 not found, but all the names are there.

Stefan Lehmann’s picture

Search for that error code and MYSQL. It looks like you broke your database server through the reinstallation.

I'd try to restart the MYSQL service, if you haven't done that already.

I like cookies!

rwhitake’s picture

Hey not sure if you're still out there... I still haven't managed to get the database back yet. I've been fooling with folder and file permissions and that doesn't seem to effect anything. It looks like the database files are in the folder (.idb files). I tried running mysqlcheck and it gave me operation failed errors for all tables. Anything else I can try?

Stefan Lehmann’s picture

Sorry .. don't think I can help you with that.

I like cookies!