When checking or repairing the data table, you can lock the data table first to ensure the security of the data table:
mysql>LOCK TABLE tbl_name READ;
mysql>FLUSH TABLES;
Lock the data table and then Perform inspection or repair work. Unlock after completion:
mysql>UNLOCK TABLES;
//LOCK TABLE tbl_name READ means to lock into a read-only state. In this state, the user can only read the data table and cannot write.
LOCK TABLE tbl_name WRITE is a stricter lock, the user cannot read or write.