myisamchk — MyISAM Table-Maintenance Utility Invoke  myisamchk  like this: The  options  specify what you want  myisamchk  to do. They are described in the following sections. You can also get a list of options by invoking  myisamchk --help . With no options,  myisamchk  simply checks your table as the default operation. To get more information or to tell  myisamchk  to take corrective action, specify options as described in the following discussion. tbl_name  is the database table you want to check or repair. If you run  myisamchk  somewhere other than in the database directory, you must specify the path to the database directory, because  myisamchk  has no idea where the database is located. In fact,  myisamchk  does not actually care whether the files you are working on are located in a database directory. You can copy the files that correspond to a database table into some other location and perform recovery operations on them there. You can name several tables on the  myisamchk  command line if you wish. You can also specify a table by naming its index file (the file with the  .MYI  suffix). This enables you to specify all tables in a directory by using the pattern  *.MYI . For example, if you are in a database directory, you can check all the  MyISAM tables in that directory like this: If you are not in the database directory, you can check all the tables there by specifying the path to the directory: You can even check all tables in all databases by specifying a wildcard with the path to the MySQL data directory: The recommended way to quickly check all  MyISAM  tables is: If you want to check all  MyISAM  tables and repair any that are corrupted, you can use the following command: This command assumes that you have more than 64MB free. For more information about memory allocation with  myisamchk , see Section 4.6.4.6, “myisamchk Memory Usage” . For additional information about using  myisamchk , see Section 7.6, “MyISAM Table Maintenance and Crash Recovery” . You must ensure that no other program is using the tables while you are running myisamchk . The most effective means of doing so is to shut down the MySQL server while running  myisamchk , or to lock all tables that  myisamchk  is being used on. Otherwise, when you run  myisamchk , it may display the following error message: 562 Important warning: clients are using or haven’t closed the table properly myisamchk --silent --force --fast --update-state \ --key_buffer_size=64M --myisam_sort_buffer_size=64M \ --read_buffer_size=1M --write_buffer_size=1M \ /path/to/datadir/*/* .MYI myisamchk --silent --fast  /path/to/datadir/*/* .MYI myisamchk  /path/to/datadir/*/* .MYI myisamchk  /path/to/database_dir/ *.MYI myisamchk *.MYI myisamchk [ options ]  tbl_name  ...