Mysql – Need correct thesqlfrm command path to restore a database from .ibd and .frm files

MySQL

I'm attempting to restore a database made up of only .ibd and .frm files.
Why I'm doing this: An uninstall of my WAMP installation left only .ibd and .frm files, and was using MySQL 5.6.12. A reinstall of WAMP has MySQL 5.6.17. The WAMP people said if I restore the database in the 5.6.12 then I'll be able to choose the 5.6.12 setup from the Aestan tray menu.

Using this post Recover MySQL database from data folder without ibdata1 from ibd files by Ronaldo, I was able to learn of a routine using mysqlfrm to DISCARD TABLESPACE and then IMPORT TABLESPACE. While that post mentioned creating a database to start, I was informed by someone else here that the ibdata1 file from the 5.6.17 installation could be used in the 5.6.12 as part of the recovery. No database has been set up in the 5.6.17 installation. So I have a "generic" ibdata1 file, I assume.

My database is located at C:\wamp\bin\mysql\mysql5.6.12\data\wordpress.

I've read in this post How can extract the table schema from just the .frm file? where I assume the user put mysqlfrm.exe in the database folder as evident by this command example: C:\MySQL_5.6.10\data\mysql>mysqlfrm --server=root:rootpassword@localhost mysql:user.frm --port=3307 In the example, they're trying to read frm files. My goal is to to establish the right location to start running Ronaldo's instructions.

I put mysqlfrm.exe in the wordpress folder and I tried this command: C:\wamp\bin\mysql\mysql5.6.12\data\wordpress>mysqlfrm --server=root:rootpassword@localhost --port=3307 but I got a Fatal Python error: cannot get zip importer instance, and Windows gave me a message about the program stopping running.

Could someone share where I should put mysqlfrm.exe, and what my command should be to get to the point where I can run mysqlfrm to run Ronaldo's routines as listed in the first link above?

Best Answer

You cannot just move the .exe around like that and expect it to work. All libraries and dll's (in your case I suspect _bz2.pyd) have to be in the same directory structure.

You can execute commands from other locations by specifying the entire path or from any directory which is in your PATH environment variable.

You could either execute

C:\wamp\bin\mysql\mysql5.6.12\data\wordpress>c:\path\to\mysqlfrm --server=root:rootpassword@localhost --port=3307

or change your PATH