16.2.1 MyISAM Startup Options

The following options to mysqld can be used to change the behavior of MyISAM tables. For additional information, see Section 5.1.7, “Server Command Options”.

Table 16.3 MyISAM Option and Variable Reference

NameCmd-LineOption FileSystem VarStatus VarVar ScopeDynamic
bulk_insert_buffer_sizeYesYesYesBothYes
concurrent_insertYesYesYesGlobalYes
delay_key_writeYesYesYesGlobalYes
have_rtree_keysYesGlobalNo
key_buffer_sizeYesYesYesGlobalYes
log-isamYesYes
myisam-block-sizeYesYes
myisam_data_pointer_sizeYesYesYesGlobalYes
myisam_max_sort_file_sizeYesYesYesGlobalYes
myisam_mmap_sizeYesYesYesGlobalNo
myisam_recover_optionsYesYesYesGlobalNo
myisam_repair_threadsYesYesYesBothYes
myisam_sort_buffer_sizeYesYesYesBothYes
myisam_stats_methodYesYesYesBothYes
myisam_use_mmapYesYesYesGlobalYes
tmp_table_sizeYesYesYesBothYes

The following system variables affect the behavior of MyISAM tables. For additional information, see Section 5.1.8, “Server System Variables”.

Automatic recovery is activated if you start mysqld with the myisam_recover_options system variable set. In this case, when the server opens a MyISAM table, it checks whether the table is marked as crashed or whether the open count variable for the table is not 0 and you are running the server with external locking disabled. If either of these conditions is true, the following happens:

If the recovery wouldn't be able to recover all rows from previously completed statements and you didn't specify FORCE in the value of the myisam_recover_options system variable, automatic repair aborts with an error message in the error log:

Error: Couldn't repair table: test.g00pages

If you specify FORCE, a warning like this is written instead:

Warning: Found 344 of 354 rows when repairing ./test/g00pages

If the automatic recovery value includes BACKUP, the recovery process creates files with names of the form tbl_name-datetime.BAK. You should have a cron script that automatically moves these files from the database directories to backup media.