Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. MySQL uses a .frm file to store the definition of the table, but this file is not a part of the MyISAM engine; instead it is a part of the server. The data file has a .MYD (MYData) extension. The index file has a .MYI (MYIndex) extension.
I will now show how to repair the corrupted databases and tables. Usually the mysql files are stored in /var/lib/mysql. Hence navigate your way to the this location.
$ cd /var/lib/mysql
You can find all the databases in the server as folders in this location and enter the folder of the corrupted database.
$ cd db_name
To check and automatically repair all tables
$ myisamchk --silent --force --fast --update-state *.MYI.
If you only want to repair a specific table give the command below:
$ myisamchk -r table_name.MYI