我有一些优化 my.cnf 文件的经验,但我的数据库有大约 400 万条记录 (MyISAM)。我正在尝试从 mysqldump 恢复,但每次我最终都会得到可怕的“使用 Keycache 修复”,这可能需要几天时间。有什么办法可以解决这个问题并让它滚动为“通过排序修复”?
我有 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