Today I had the pleasure of losing all my databases.
Luckily I had the data folder still intact and with all .frm and .ibd files.
Googling for a few hours I came up with a solution that helped me recreate the .sql file, and table structure, and then import the .ibd file.
The biggest helper with all of this was mysqlfrm, which I found to be discontinued. Not sure I would have been able to do this without it.
This was my process:
Export tables to .sql file
mysqlfrm --server=root:root@127.0.0.1 ./*.frm --port 3301 > ./dbtables.sql
Get all create table commands for easier discard/import tables.
This was used with the dbtables.sql file to get all instances of create table so it would be easier to find and replace ALTER TABLE mytable DISCARD TABLESPACE/IMPORT TABLESPACE.
^[CREATETABLE].*+$
Discard .ibd files command:
ALTER TABLE mytable DISCARD TABLESPACE;
After discarding, copy the .ibd files from you database folder into the "live" version.
Import .ibd files command:
ALTER TABLE wp_actionscheduler_actions IMPORT TABLESPACE;
Do you know of a modern way to restore a DB using just .frm, .ibd files?
Google and Stack Overflow mostly point to old ways/tools that don't work anymore.
A solution for any OS would be great as I have access to all so can test them without issues, hopefully.