블로그서버가 어느날 갑자기 정전됐다가 복구된 이후 mysqld.log가 일주일도 안되서 500MB 이상 쌓이는 현상이 발생했다.
로그를 살펴보니 텍스트큐브의 특정 테이블이 깨져서 복구를 하라는 메시지가 보였는데, 별 신경안쓰고 로그만 지웠더니 자꾸 문제가 발생하여 테이블을 복구 하였다.
## mysqld.log 메시지
[root@Mapoo-Server ~]# tail /var/log/mysqld.log -n 5
130502 17:09:04 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:04 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:05 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:05 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:05 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
## 복구하기
[root@Mapoo-Server ~]# mysql -u ****** -p tc7
mysql> REPAIR TABLE tc_PageCacheLog;
+---------------------+--------+----------+------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------------+--------+----------+------------------------------------------+
| tc7.tc_PageCacheLog | repair | warning | Number of rows changed from 1332 to 1287 |
| tc7.tc_PageCacheLog | repair | status | OK |
+---------------------+--------+----------+------------------------------------------+
2 rows in set (0.03 sec)
mysql> quit
## 복구 후 mysqld.log를 보니 복구가 되었다는 로그가 보이고, 더이상 같은 로그가 안 쌓인다.
[root@Mapoo-Server ~]# tail /var/log/mysqld.log -n 5
130502 17:09:04 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:04 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:05 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:05 [ERROR] /usr/libexec/mysqld: Table './tc7/tc_PageCacheLog' is marked as crashed and should be repaired
130502 17:09:07 [Note] Found 1287 of 1332 rows when repairing './tc7/tc_PageCacheLog'