Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By rwhitake on
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
Definitely first backup your
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!
No this is either a problem
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.
Does the error message say
Does the error message say anything else, eg. which table it is not finding?
I like cookies!
Here's the full message from
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
So that simply means that
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!
In phpMyAdmin when I click
In phpMyAdmin when I click any entry in the pre-existing database it returns 1146 not found, but all the names are there.
Search for that error code
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!
Hey not sure if you're still
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?
Sorry .. don't think I can
Sorry .. don't think I can help you with that.
I like cookies!