记事狗微博4.0.1系统出现Out of resources when opening file '.\admpub\jishigou_members#P#p11.MYD'错误的解决办法备忘

admpub 发表于 [PHP] 分类,标签: PHP代码 故障排除 记事狗微博
0

在安装前修改文件:\install\global.func.php

将代码:

$ex = ' PARTITION BY HASH (uid) PARTITIONS 100';

替换为:

                           $ex = ' PARTITION BY RANGE (uid) (
                            PARTITION p0 VALUES LESS THAN (50000),
                            PARTITION p1 VALUES LESS THAN (100000),
                            PARTITION p2 VALUES LESS THAN (150000),
                            PARTITION p3 VALUES LESS THAN (200000),
                            PARTITION p4 VALUES LESS THAN (250000),
                            PARTITION p5 VALUES LESS THAN (300000),
                            PARTITION p6 VALUES LESS THAN (350000),
                            PARTITION p7 VALUES LESS THAN (400000),
                            PARTITION p8 VALUES LESS THAN (450000),
                            PARTITION p9 VALUES LESS THAN (500000),
                            PARTITION p10 VALUES LESS THAN MAXVALUE
                            )';

再将代码:

$ex = ' PARTITION BY HASH (tid) PARTITIONS 100';

替换为:

                          $ex = ' PARTITION BY RANGE (tid) (
                            PARTITION p0 VALUES LESS THAN (50000),
                            PARTITION p1 VALUES LESS THAN (100000),
                            PARTITION p2 VALUES LESS THAN (150000),
                            PARTITION p3 VALUES LESS THAN (200000),
                            PARTITION p4 VALUES LESS THAN (250000),
                            PARTITION p5 VALUES LESS THAN (300000),
                            PARTITION p6 VALUES LESS THAN (350000),
                            PARTITION p7 VALUES LESS THAN (400000),
                            PARTITION p8 VALUES LESS THAN (450000),
                            PARTITION p9 VALUES LESS THAN (500000),
                            PARTITION p10 VALUES LESS THAN MAXVALUE
                            )';

然后再进行安装操作,经本人测试,安装后就不会再有类似于“Out of resources when opening file '.\admpub\jishigou_members#P#p11.MYD'”这样的错误提示了。

如果已经安装了,并且又不想重新安装,可以使用adminer来修改分区:

点击一个表进入,然后点击“更改表”,在打开的页面最下面可以看见修改分区项,做类似于这样的修改就可以了:点击查看原图

不过需要一个个的表进行修改,一共要修改5个表,主键为uid的表members和memberfields以及主键为tid的表topic、topic_more的topic_reply(这里表的前缀就省略了,根据自身的实际情况添加表前缀吧),分别将对应的主键字段名填写到上图被括号包围起来的输入框中即可,例如上图中的tid。

记事狗微博4.0.1中默认为这五个表都分了100个HASH分区,这并不适用于所有网站,完全没有必要。再者,根据HASH分区的特性,他会打开所有分区检索数据,这就造成了“Out of resources when opening file '.\admpub\jishigou_members#P#p11.MYD'”这样的错误的出现。

发表我的评论