【发布时间】:2009-07-01 05:11:05
【问题描述】:
我有一些优化 my.cnf 文件的经验,但我的数据库有大约 400 万条记录 (MyISAM)。我正在尝试从 mysqldump 恢复,但每次我最终都会得到可怕的“使用 Keycache 修复”,这可能需要几天时间。有什么办法可以解决这个问题,让它滚动为“Repair By Sorting”?
我有 2GB RAM、双核、大量额外的硬盘空间。
从 my.cnf 中剪掉:
set-variable = max_connections=650
set-variable = key_buffer=256M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer_size=2M
set-variable = read_buffer_size=2M
set-variable = query_cache_size=32M
set-variable = table_cache=1024
set-variable = thread_cache_size=256
set-variable = wait_timeout=7200
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10
set-variable = thread_concurrency=8
【问题讨论】:
-
你应该接受 MarkR 的回答。
-
Marc Gear 的答案应该是被接受的,因为磁盘空间通常不是问题,而
myisam_max_sort_file_size设置为低值更有可能发生