set character_set_client = 'gbk';
set character_set_connection = 'gbk';
set character_set_results = 'gbk';
set character_set_server = 'gbk';
set character_set_database = 'gbk';
修复msitetype表:                     repair table msitetype ;
修改所有下载机的线程数和最大下载数量(因cpu过高):     UPDATE mspidercontrol SET threadNum=200,downNum=200
site表:
信息源统计:
                          总数:           SELECT COUNT(*) FROM msite;
                          某分类下的信息源数量:             SELECT COUNT(*) FROM msite where sitetype=1;
                          类型为新闻的信息源数量:           SELECT COUNT(*) FROM msite where sitetype=0;
                          下载机名字为bbs的信息源数量:      SELECT COUNT(*) FROM msite WHERE spidername='bbs';
                                    
统计信息源中共设置了几个下载机:     select DISTINCT spidername from msite
                                           
修改国内重点论坛分类下的下载机名字          
                                             UPDATE msite SET spidername='news' WHERE spidername='one'
                                             UPDATE msite SET spidername='bbs' WHERE sitetype=1;
                                             UPDATE msite SET spidername='news' WHERE sitetype=0;
                                             UPDATE msite SET spidername='three' WHERE typeid<340;
                                           
                                             UPDATE msite SET spidername='gnbbs' WHERE typeid BETWEEN 19 AND 27 ;
                                           
                                             UPDATE msite SET spidername='two'
                                             update msite set starttime='2011-1-17 00:00:00' where sitetype=0;
                                           
                                           
暂停所有信息源:update msite set status=1;
启动所有信息源:UPDATE msite SET STATUS=0;
修改所有信息源的持续时间为1分钟,间隔时间为2分钟: UPDATE msite SET interMinute=2,standMinute=1
UPDATE msite SET downThreadNum=1
UPDATE msite SET downThreadNum=1
SELECT * FROM msite WHERE typeid=5
UPDATE msite SET depth=5,linkformat="" where typeid=9
delete from mtexttemplet

删除论坛统计中,信息源名字为猫扑贴贴论坛的数据。    DELETE from marticle where sitename='猫扑贴贴论坛'
删除论坛统计中,信息源id为10的数据。                DELETE from marticle where siteid=10
删除MSITETYPE表中id>420的数据:
DELETE FROM MSITETYPE WHERE ID > 420

DELETE FROM MSITE WHERE TYPEID > 420
marticle表:
论坛统计仅保留一个月数据:        delete from marticle where publishtime < '2010-12-25 00:00:00'
删除论坛统计错误时间格式  如0009-01-09 14:14:14    :    delete from marticle where publishtime like '%000-%'

delete from muser where organizationid not in(1);
delete from msubject where organizationid not in(1);
delete from mmodule where organizationid not in(1);
delete from morganization where id not in(1);
DELETE FROM morganization WHERE id NOT IN(1,50,49,58);
delete from mspidercontrol;
删除下载日志:   delete from mdownlog;
设置新闻下载深度为5:update msite set depth=6 where sitetype=0
更新同一个组织下所有用户的信息源:
update muser set sitetypeids='1',siteids='1' where organizationid=84;
更新同一个组织下所有专题的信息源:
update msubject set sitetypeids='1;19;24;25;27;2;10;12;13;14;15;5;70;59;60;61;62;68;69;67',siteids='19;6;325;326;327;328;329;330;331;347;348;349;350;351;352;353;354;3;355;356;357;358;359;8;365;366;367;368;369;370;371;372;373;28;29;30;203;204;205;206;207;208;209;210;211;212;213;214;36;37;38;39;235;236;237;238;239;241;242;243;40;41;42;255;256;257;258;259;260;261;262;263;264;265;266;823;824;825;822;821;884;883;881;882;880;879;878;877;876;875;874;873;872;870;869;868;867;866;865;863;864;862;861;871;767;768;832;831;830;829;828;827;826;843;840;836;834;833;842;841;844;845;846;847;848;892;893;888;889;890;891;885;886;887;849;850;851'
删除除了管理组织外的所有组织的首页配置:
DELETE FROM mmodule WHERE organizationid!=1

use monitor;
UPDATE muser set status=0 where organizationid not in (1,55,81,83);

iget5:
REPAIR table msite;
REPAIR table msitetype;
REPAIR table mtexttemplet;
REPAIR table mdownlog;
REPAIR table mspidercontrol;
REPAIR table mlinkinfo;
REPAIR table muser;
REPAIR table mbbstopic;


monitor:
REPAIR table marticle;
REPAIR table morganization;
REPAIR table muser;
REPAIR table msubject;
REPAIR table mfavorite;
REPAIR table mfavoritearticle;
REPAIR table mmodule;

 
如果您的服务器是独立主机强烈建议使用命令行方式进行修复:
修复前将mysql服务停止。
如果是Win主机,打开命令行方式,然后进入到mysql的/bin目录。
执行myismachk -r d:\mysql\data\discuz\*.MYI
其中d:\mysql\data\discuz\换成您的数据库所在路径。
如果是类Unix主机,直接使用myisamchk -r 数据库目录\*.MYI
即可。

下面,用另外一个命令mysqlcheck来代替myisamchk

1. 检查数据库中的表   //可能需要关闭下载

mysqlcheck -s -u username -p database(改为你要检查修复的库名,下同)

ignore session and cp session table messages

2. 修复 table

mysqlcheck -r -q -u username -p database 


3. 再检查

mysqlcheck -s -u username -p database

如果还有错,继续修复

====================================