Answer the question
In order to leave comments, you need to log in
Ways and tools to monitor the health of MySQL tables?
Recently, some nonsense has begun, tables break from time to time. In this case, a table, for example, may be available for selection, but not available for writing. Or not available at all. All you have to do is REPAIR TABLE. I don’t understand why Muskul himself, understanding the whole situation, cannot execute this command himself in case of a breakdown, because there seems to be no other means to repair the table.
In this regard, I'm going to write a script that will do a CHECK TABLE of all significant tables at midnight and make REPAIR broken.
Actually, the question is: is this generally a normal solution? Are there any civilized means of solving such problems, some monitoring utilities or some kind of autorepair?
Thank you.
Answer the question
In order to leave comments, you need to log in
If you have MyISAM tables, try replacing them with INNODB, this helped us in one project. As far as I understand, MyISAM doesn't handle large and frequently updated tables well. That's why they crash. In general, you need to look for the source of the problem, most likely it is a hard drive (do you have a RAID?). Cache queries whenever possible to offload the database
As an option, it will do, but it’s better to do it more than once a day, but more often, for example, once an hour. Writing to critical tables is better to lock at the level of some kind of adapter, do a script check for brokenness, in which case - fix it, and then open the lock.
In general, it is worth at least trying to find the cause of the breakage of the tables. Maybe somewhere on the forums you will find a description of similar problems. Alternatively, try updating the DBMS version, maybe this is a bug and it has already been fixed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question