Thursday 15 January 2015

Restore MySQL database from MyISAM tables

It is assumed that you have a back up copy of MyISAM tables (.frm,.myd,.myi)

Each MyISAM table is stored on disk in three seperate files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension.

Steps:

1) Stop running instance of MySQL Server.
2) Copy database folder containing frm,MYI and MYD files from your backup to  MySQL data directory - e.g. /var/lib/mysql
3) Change the permission of the folders to mysql.mysql so that mysql instance can read the files/directories.
4) If required, please check and repair all database tables using 'myisamchk'.

Note- While restoring the database, use the same MySQL server version.

No comments:

Post a Comment