I have an application in C language which inserts the report data in MyISAM table by using mysql_stmt_execute() function.
Due to load on the table, it gets crashed.

For auto repair of crashed table, I have added following option in /etc/my.cnf file


When the table gets into a crashed state, then mysql_stmt_execute() function fails and I can't insert the reports. As I have specified recovery options, expected result should be, table gets repaired and application should work fine.


  • How to repair the table automatically when it gets crashed ?
  • Why myisam-recover-option can't recover the table when query is executed ?

1 Answer 1


myisam_recover_options is not a dynamic variable. It is among the startup options for MyISAM.

If you have set this option in my.cnf, mysqld must be restarted

Please restart mysqld with

# service mysql restart

or if you have Windows

C:\> net stop mysql
C:\> net start mysql

You should try switching your table to InnoDB and make your table crash-safe.

  • Thanks Ronaldo for your answer. After adding option in my.cnf I have restarted mysqld service, but mysql_stmt_execute() still fails. I manually repair the table with myisamchk utility. Please suggest me the way which will automatically repair the table when it goes in crashed state. Apr 18, 2016 at 4:22
  • Is there any specific reason to stick with MyISAM instead of Innodb?
    – kasi
    Mar 1, 2019 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.