Sell And Buy

Thursday, 9 April 2015

How to import .frm, .myd and .myi files in mysql database in XAMPP

First Create a database in phpmyadmin.
Mysql database is actually stored in C:\xampp\mysql\data (Here I have install Xampp in C: Drive) folder, there is a folder of your database name in this folder which has a lot od files mainly of three extensions: MYI, FRM, MYD. You can see your recently created database here.
Just copy all the files with extensions(.myi,.frm,.myd) and paste it into your database folder.

Then stop your database and start again and check your database( http://localhost/phpmyadmin).
You will fill all tables are sucessfully imported to your database.

And finally I figured out the following simple steps to restore the db from MYI, FRM, MYD files

  1. Create a database from phpmyadmin with the same dbname on your new wamp
  2. Copy the .FRM and .MYD tables to your wamp/bin/mysql/data/dbname folder
  3. Go to PHP myadmin repair all the tables
  4. Done

How to Repair MySQL Database Tables?

Open the database which should be repaired.
Select the tables that need repair and pick the Repair table action from the drop-down menu located below the tables' list.

The tables will be repaired and you will get a confirmation screen.

How to Optimize MySQL Database Tables?

Open the database which you want to optimize.
Select the tables that need optimization.

From the drop-down menu pick the Optimize table option.
After the tables' optimization a confirmation message with a list of the optimized tables will be visualized on the screen.