Using mysqlfrm against XAMPP installed mySQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Using mysqlfrm against XAMPP installed mySQL

Postby iwildman » 31. July 2019 14:54

Has anyone every got mysqlfrm to work when spawning a mysql process via mysqlfrm when mysql was installed via xampp?
iwildman
 
Posts: 1
Joined: 31. July 2019 13:03
XAMPP version: 3.2.4
Operating System: Windows various

Re: Using mysqlfrm against XAMPP installed mySQL

Postby ralplpcr » 04. November 2021 19:07

I have - - and it does require some patience to make it work.
The trick is to use the "--diagnostic" flag. The output does show a warning, but the SQL code itself does function.

Example: Let's say you have a database named "mydata", with 2 INNODB tables: "stuff" and "address". You'll have to run mysqlfrm for each table:
Code: Select all
mysqlfrm --diagnostic "C:\backup_copy\mydata\stuff.frm" > "C:\to_restore\mydata\stuff.sql"

mysqlfrm --diagnostic "C:\backup_copy\mydata\address.frm" > "C:\to_restore\mydata\address.sql"


You can then go through the painful process of creating the database and then importing each .SQL file into it.
Code: Select all
mysql -u root --password=<yourpassword>
create database `mydata`;
exit

mysql -u root --password=<yourpassword> mydata < "C:\to_restore\mydata\stuff.sql"

mysql -u root --password=<yourpassword> mydata < "C:\to_restore\mydata\address.sql"


Once you're done with that, you have to apply the following command to each table:
Code: Select all
ALTER TABLE `mydata`.`stuff` DISCARD TABLESPACE;
ALTER TABLE `mydata`.`address` DISCARD TABLESPACE;

This should remove the .IBD files from the C:\xampp\mysql\data\mydata\ directory.
You would then copy the "good" .IBD files into their spot.
Once they're copied over, you need to re-activate the INNODB link:
Code: Select all
ALTER TABLE `mydata`.`stuff` IMPORT TABLESPACE;
ALTER TABLE `mydata`.`address` IMPORT TABLESPACE;


That should be it! The data in your copied .IBD files should now be active within your INNODB tables. :)
ralplpcr
 
Posts: 14
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 131 guests