I have managed to recover my data. (so happy)
After hours of reading forums and solutions I found a way to fix it. Here's what I did:
- In xampp I backed up my old copy (after crash) of folder
DbScrapes
(dbname) from C:\xampp\mysql\data
with files db.opt
, scraped_user.frm
, scraped_user.ibd
- In
C:\xampp\mysql\data
I backed up an old copy (after crash) of files ib_logfile0
, ib_logfile1
, ibdata1
.
- Uninstalled my xampp
- Restarted my computer to be sure ports that xampp is using will be close
- Checked if there is a MySQL service in
services.msc
- On my computer there was a MySQL service.
- I deleted it using cmd command
sc delete "service_name"
- Restart again to make sure everything is fresh.
- Installed a new copy of xampp
- Test if apache and MySQL is ok, if it's ok click stop
- Copy the files that I have backed up to the location where I get them so it's
C:\xampp\mysql\data
- Run xampp's apache and MySQL again.
Now I'm running xampp and I have my data.
Note: Don't delete ibdata1
- it will delete all your database tables.
The crashing issue I think was a bug in xampp.
ok, i best solution which suited me well.
for being cautious in choosing the above solutions provided in my question above..
(cuz the solutions didn't guarantee 100% that my data would be intact), i made a backup for my drupal database folder just in case.
chose solution (2), which is adding the force_recovery..but no luck in fixing the problem..
so i went to the location of the corrupted file in "C:\xampp\mysql\data\bitnami_drupal7", and moved the corrupted file to another folder (NOTE: i did not delete the corrupted file).
then started mysql service, and viola! my drupal was back to life again.
and i was able to access phpmyadmin with sql queries.
(back then, mysql couldn't execute sql queries because it was in a state where its about to crash).
i went straight to the cache tables of drupal to clear them..
(back then, i wanted to clear drupals' cache since the error started, cuz ever since i knew that mysql crashes because of a table in drupal; but mysql couldn't have enough time to execute sql queries in phpmyadmin, again cuz of the the crash).
hence, after clearing all drupal cache at "bitnami_drupal7" with this code:
TRUNCATE TABLE cache;
TRUNCATE TABLE cache_block;
TRUNCATE TABLE cache_bootstrap;
TRUNCATE TABLE cache_field;
TRUNCATE TABLE cache_filter;
TRUNCATE TABLE cache_form;
TRUNCATE TABLE cache_image;
TRUNCATE TABLE cache_menu;
TRUNCATE TABLE cache_page;
TRUNCATE TABLE cache_path;
TRUNCATE TABLE cache_token;
TRUNCATE TABLE cache_update;
then, i replaced the corrupted file back again to try if it becomes recognized or not, and started mysql..and it worked!!
mysql never crashed again and complain about that file being corrupted anymore, and that saved me from deleting or affecting any data.
Best Answer
I had this problem too. If changing MySQL port doesn't solve the issue, which was my case. Simply copy the files in xampp/mysql/backup to xampp/mysql/data. Replace any conflicting files and leave the rest.
Then restart Apache and MySQL from the Xampp control panel.
This should solve the problem.