# Need correct mysqlfrm command path to restore a database from .ibd and .frm files

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?

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


• Here is the path I tried: C:\wamp\bin\mysql\mysql5.6.12\data\wordpress>c:\utilities\mysqlfrm --server=root:rootpassword@localhost --port=3307. I got this set of responses: WARNING: Using a password on the command line interface can be insecure. Usage: mysqlfrm --server[user[:<pass>]@host[:<port>][:<socket>]:<login-path>[:<port>][:<socket>]] [path\tbl1.frm:db:tbl.frm] and mysqlfrm: error: Nothing to do. You must specify a list of paths or files to read. See --help for more information and examples. Then the command prompt goes back to C:\wamp\bin\mysql\mysql5.6.12\data\wordpress> – David Borrink Aug 13 '16 at 23:19
• So nowhere with mysqlfrm. Obviously mysqlfrm did run in the above. In order to establish contact to run Ronaldo's routine as linked to above in my question. I assume I need to connect to the ibdata1 file in my data folder and if I get the mysqlfrm prompt to come up and stay up, I can run those commands to discard and import the tablespaces. So what am I doing wrong here? Or is it wrong to expect the ibdata1 file to be a clean new file to work with? – David Borrink Aug 13 '16 at 23:26