4

I uninstalled WAMP on Win7. It removed everything but kept the data folder containing my database. After installing WAMP again on same directory, I thought it will recover MySQL database but it didn't.

It does show me my database and when I expand it in phpMyAdmin, I can see the tables but when I try to query them, it says, #1146 - Table 'tablename' doesn't exist

I searched and found a couple of posts. This post is close enough but it is for Linux and not exactly my case.

Any help will be appreciated.

UPDATE 1: I tried repeating the steps mentioned here

  1. Stopped MySQL service,
  2. Renamed old database directory,
  3. Started MySQL service,
  4. Created new database with same name, and replaced all database files on it

Still got the same error.

UPDATE 2: I tried repeating the steps mentioned here as well Still getting the same error.

UPDATE 3: Examining .err file revealed the below error:

[Warning] InnoDB: Cannot open table testdb/rules from the internal data dictionary of InnoDB though the .frm file for the table exists.

UPDATE 4: CHECK TABLEtablename; resulted in following errors

Warning InnoDB: Tablespace is missing for table 'db/tablename'
Error   Table 'db.tablename' doesn't exist
status  Operation failed
Community
  • 1
  • 1
Muhammad Ali
  • 330
  • 3
  • 13

1 Answers1

0

Why don't you uninstall and then reinstall WAMP with backup datafiles in data directory. sometimes it solves problem.

I suggest you to always export your DB before doing any serious modifications.

Here is a thread for how to recover data This may be helpful to you

Community
  • 1
  • 1
user2816085
  • 655
  • 4
  • 19
  • Thanks for the reply. I did the same thinking it would have the database. I tried solutions given in that thread but its not working. table names are shown but getting error table doesnt exist when i query them. Could it be because of some permissions? – Muhammad Ali Feb 14 '16 at 06:04
  • May be, or you should, try check table t1; repair table t1 in sql. – user2816085 Feb 14 '16 at 06:16
  • Thanks for the reply. I tried that too but it didn't work :( I have updated my question for the error message. – Muhammad Ali Feb 14 '16 at 06:24
  • You could check this. I have not personally tested it but sound useful however for MAMP: https://www.quora.com/profile/Jordan-Ryan/Web-Dev/How-to-Recover-innoDB-MySQL-files-using-MAMP-on-a-Mac – user2816085 Feb 16 '16 at 10:23