I had an interesting situation come up that required attempting to recover a database in a failed Local install that would not open anymore. The biggest factor here was that it was a pre Local 5.0.7 version, where Local did not export the database to a SQL file when site services were stopped. This meant that my only copy of the database was in the raw database folder in Local.
In Windows that is located here:
%AppData%\Local\run[sitehash]\mysql-raw-data
On a Mac that is:
~/Library/Application Support/Local/run/[sitehash]/mysql-raw-data
You may have a number of sites there, which will make locating which sitehash folder a little trickier.
The site-level database files are in the /local/ folder within the /mysql-raw-data/ folder. The local
folder contains .ibd files but no .frm which would be required for most recovery options. From what I googled, you might be able to recover with just the .ibd files but it will be a LOT more work.
I was able to:
- Copy the /mysql-raw-data/ folder to another location
- Get Local back up and running (following the manual removal instructions and reinstalling)
- Create a new, blank site in local and stop the services
- Replace the /mysql-raw-data/ folder in the blank site
- Start the site up, open Adminer, export the database to a SQL file
In my tests, the OS environment is very important. I have been able to use the same method in Mac and Windows with positive results but I have not been able to move across platforms.