首页 > tips, TroubleShooting > mysql中MyISAM类型的库的表数据文件最大4G?!

mysql中MyISAM类型的库的表数据文件最大4G?!

2010年12月20日 发表评论 阅读评论

一台服务器
32位的系统
2.6+的kernel
mysql为5.0.x版本
从别处拷过来一个库的数据文件
其中有好些都是4个G左右的文件
然后重启mysql的时候起不来
发现挂在myisamchk那里
k掉myisamchk进程
手工去掉–silent参数执行
发现报警告:

myisamchk: warning: Datafile is almost full, 4294967284 of 4294967294 used

用下面命令查了下这个index文件:
# myisamchk -dv deadlink.MYI
发现输出:

MyISAM file: deadlink.MYI
Record format: Packed
Character set: latin1_swedish_ci (8)
File-version: 1
Creation time: 2005-10-14 1:59:45
Recover time: 2005-11-21 8:22:40
Status: open,changed
Data records: 22090591 Deleted blocks: 0
Datafile parts: 52483933 Deleted data: 0
Datafile pointer (bytes): 4 Keyfile pointer (bytes): 4
Datafile length: 4294967284 Keyfile length: 2733665280
Max datafile length: 4294967294 Max keyfile length: 4398046510079
Recordlength: 53

table description:
Key Start Len Index Type Rec/key Root Blocksize
1 2 32 unique char packed stripped 1 390373376 1024
2 48 1 multip. binary NULL 2817245 61083648 1024
3 49 4 multip. unsigned long 1 1840502784 1024
4 49 4 multip. unsigned long 1 572611584 1024
44 4 long 1
5 44 4 multip. long 41430 633276416 1024
49 4 unsigned long 1

然后又翻了翻mysql文档
发现这个Max datafile length是可以改的
可以通过alter table tablename MAX_ROWS=1000000000 AVG_ROW_LENGTH=nnn;来修改

原创文章,转载请注明: 转载自嘻嘻哈哈的部落格(blog)

本文链接地址: mysql中MyISAM类型的库的表数据文件最大4G?!

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word