MySQL / Zabbix – Table is marked as crashed and should be repaired
An error appeared in the Mysql logs (/var/log/mysql.log):
150729 16:45:44 [ERROR] /usr/sbin/mysqld: Table ‘./zabbix/hystory’ is marked as crashed and should be repaired
Connecting to mysql
[[email protected] ~]# mysql -u %username% -p
Enter password:
Choosing a base
mysql> use zabbix;
Rebuilding the table
mysql> REPAIR TABLE hystory;
The same actions can be done via phpmyadmin (sql query)
If there are many tables in the database with the error Table is marked as crashed and should be repaired:
- Restoring the user_base base
[[email protected] ~]# mysqlcheck -uUSER -pPASSWORD --repair --extended user_base
- We restore all bases
[[email protected] ~]# mysqlcheck -uUSER -pPASSWORD --repair --extended -A