1

I have a mysql server(version: 5.5.3-m3-log Source distribution ) and it keeps showing lots of

110214  3:01:48 [ERROR] /usr/local/mysql/libexec/mysqld: Table './mydb/tablename' is marked as crashed and should be repaired
110214  3:01:48 [Warning] Checking table:   './mydb/tablename'

I'm wondering what can be the possible casues and how to fix it. Here is a full list mysql configuration :

connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 2G 
max_length_for_sort_data = 2G
join_buffer_size = 256M
thread_cache_size = 300
#thread_concurrency = 8
query_cache_size = 512M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
long_query_time = 3
log-slave-updates = 1
log-bin = /data/mysql/3306/binlog/binlog
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_si    ze = 1G
relay-log-index = /data/mysql/3306/relaylog/relaylog
relay-log-info-file = /data/mysql/3306/relaylog/relaylog
relay-log = /data/mysql/3306/relaylog/relaylog
expire_logs_days = 30
key_buffer_size = 1G 
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 2G 
myisam_max_sort_file_size = 5G
myisam_repair_threads = 1
max_binlog_size = 1G
interactive_timeout = 64 
wait_timeout = 64
skip-name-resolve
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396

The box is running on centos-5.5. Thanks for your help.

3 Answers 3

1

Although corrupt data is few and far between. It is the nature of the beast we work with.

Just run time mysqlcheck mydb tablenam -r

That should help.

Was your machine hard rebooted or something.

2
  • Thanks. Do I have to stop mysql to do mysqlcheck?
    – Shawn
    Feb 14, 2011 at 6:57
  • No, but you should. You can do repair table within the mysql shell too, that'll lock the table(s) while repairing.
    – 3molo
    Feb 14, 2011 at 7:14
1

For the "fixing" part, you can also put "myisam-recover-options" (same as "myisam-recover" before 5.5.3) in your my.cnf, this way MySQL will attempt to repair MyISAM tables on the fly - Differents options exists, see MySQL Documentation

0

If you're getting this kind of error as much as your question suggests you should be looking at things other than MySQL itself. MySQL is not prone to producing repeated multiple errors like that without some outside help. I suggest you run some serious diagnostics on both your hard drive(s) and your RAM before going any further.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .