Is there a tool to check mysql/mariadb database is all OK? Today, Mariadb went down on one of my servers. The specific issue was something to do with ibdata1 file being locked. I found a website that showed how to fix it, and so all was OK. So I thought. 

30 minutes later it went down again, same issue, same fix. 

Its now running OK but I am worried it will happen again. I dont know why this would just happen when its been running fine for so long. Its a Linode server that runs Virtualmin for LAMP stack website hosting. Quite straightforward. 

So I wondered if there is some sort of tool that can check over the DB and files to check there is nothing corrupt or untoward. Much like you do for operating systems, checking the disk is OK, defragging windows etc. Anything that gives the DB a once over to check all is OK.
Verifying that a MariaDB or MySQL instance is "OK" is a complicated task, not least because there are different levels of "OK", and one man's "OK" is another man's "not OK". There are various tools you can use, though. To name a few in no particular order:


Percona Toolkit's pt-variable-advisor
SHOW ENGINE ... e.g. SHOW ENGINE INNODB STATUS\G, 
Activate and check the slow query log 
PMM - Percona Monitoring &amp; Management
MONyog
mysql-tuner, see e.g. article here.