Is mysqlcheck output buffered
(This "Answer" does not answer the Question; it eliminates the Question.)

Don't use MyISAM; switch to InnoDB.  That gets rid of the need to repair tables.

Don't use MyISAM; switch to InnoDB.  That gets rid of the need to OPTIMIZE tables.