2015-05-26 11:40:42
- UPDATE `cdb_forums` SET `allowpostspecial` = '31'
- UPDATE cdb_threads SET views=点击数 WHERE tid=主题编号;
- UPDATE `cdb_forums` SET `allowmediacode` = '1'
- update cdb_settings set value = 120 WHERE variable = 'maxavatarpixel'
- 调整所有用户最大头像尺寸(像素)为120
- UPDATE `cdb_threads` SET `closed` = '1' WHERE `fid` =20 ;
把发帖数为0的用户都转到某个用户组
- update cdb_members set groupid = * where posts = 0;
- UPDATE `cdb_usergroups` SET `allowinvite` = '1', `inviteprice` = '价格';
- replace INTO cdb_settings VALUES ('watermarktype','0');
- update cdb_members set lastpost='1186675200';
- UPDATE `cdb_forums` SET `status` = '1',
- `lastpost` = '' WHERE `fid` =6 LIMIT 1 ;
完整关闭supesite的sql语句:
- UPDATE `cdb_settings` SET `value` = '' WHERE `variable` = 'supe_siteurl' ;
- UPDATE `cdb_settings` SET `value` = '' WHERE `variable` = 'supe_sitename';
- UPDATE `cdb_settings` SET `value` = '0' WHERE `variable` = 'supe_status';
- UPDATE `cdb_settings` SET `value` = '' WHERE `variable` = 'supe_tablepre';
- UPDATE `cdb_settings` SET `value` = '0' WHERE `variable` = 'supe_circlestatus';
- update cdb_threads set fid=B板块ID,typeid=c分类的ID where fid=A板块ID;
- update cdb_posts set fid=B板块ID where fid=A板块ID;
去除后台管理员ip登录限制
- UPDATE `cdb_settings` SET `value` = '' WHERE CONVERT( `variable` USING utf8 ) ='adminipaccess' LIMIT 1 ;
- delete from cdb_styles where styleid=5 limit 1;
- UPDATE `cdb_members` SET `pmsound` = '1'
- delete from cdb_usergroups where groupid = 0
- UPDATE `cdb_forums` SET `alloweditpost` = '1'
- delete from cdb_settings where variable='insenz'
关闭游客浏览所有版块的语句
可以这样构造SQL语句
- update cdb_forumfields set viewperm ='\t允许浏览的用户组的ID\t' where fid in(论坛板块ID)
UPDATE cdb_forumfields SET rules = ‘板块规则’
所有板块的板块规则设置~!
- UPDATE `cdb_forums` SET `jammer` = '1'
开启所有会员组邀请注册的权限
- UPDATE cdb_usergroups SET allowinvite=1, allowmailinvite=1, maxinvitenum=10, maxinviteday=15, inviteprice=10;
修改最高日发帖数
- UPDATE `cdb_settings` SET `value` = '昨日发帖数 最高日发帖数' WHERE `variable` ='historyposts' LIMIT 1 ;
‘昨日发帖数 最高日发帖数’ 中间的空格是tab键~!
- UPDATE `cdb_settings` SET `value` = '0' WHERE CONVERT( `variable` USING utf8 ) = 'gzipcompress' LIMIT 1 ;
批量对用户组禁言
- update cdb_members set adminid='-1', groupid='4' where groupid='?';
- delete from cdb_threads where authorid=0;
- delete from cdb_posts where authorid=0;
- update cdb_members set credits=0,extcredits1=0,extcredits2=0,extcredits3=0,extcredits4=0,extcredits5=0,extcredits6=0,extcredits7=0,extcredits8=0 where uid > 2000 and uid < 3000;
- update cdb_threads set displayorder=0 where tid > 最小的 tid and tid < 最大的 tid
- update cdb_posts set invisible = 0 where tid > 最小的tid and tid < 最大的 tid
- delete from cdb_threads where displayorder=-2;
- delete from cdb_posts where invisible=-2;
- UPDATE cdb_threads SET closed = 1 WHERE special=1
- UPDATE `cdb_members` SET `secques` = ''
清空某个用户组的全部积分sql:
- update cdb_members set credits = 0, extcredits1 = 0, extcredits2 = 0, extcredits3 = 0, extcredits4 = 0, extcredits5 = 0, extcredits6 = 0, extcredits7 = 0, extcredits8 = 0, where groupid = 用户组id;
- update cdb_threads set readperm=100 where dateline<1133300000
把2005年1月1日以前的阅读权限设高.
- update cdb_threads set readperm=100 where dateline<1104537600 and digest=0
- update cdb_ratelog set uid = '新uid', username = '新username' where uid = '旧的 uid';
- update cdb_attachments set readperm=1
- SELECT count(`extcredits1`) FROM `cdb_members` where `posts`=0
- UPDATE `cdb_members` SET `showemail` ='1' WHERE `uid` in(1,2,3,4,5,6);
- update cdb_threads set tid=tid-16761780 where tid>14651;
- update cdb_posts set tid=tid-16761780 where tid>14651;
- update cdb_attachments set tid=tid-16761780 where tid>14651;
- update cdb_myposts set tid=tid-16761780 where tid>14651;
- update cdb_activities set tid=tid-16761780 where tid>14651;
- update cdb_activityapplies set tid=tid-16761780 where tid>14651;
- update cdb_favorites set tid=tid-16761780 where tid>14651;
- update cdb_mythreads set tid=tid-16761780 where tid>14651;
- update cdb_paymentlog set tid=tid-16761780 where tid>14651;
- update cdb_polloptions set tid=tid-16761780 where tid>14651;
- update cdb_polls set tid=tid-16761780 where tid>14651;
- update cdb_pushedthreads set tid=tid-16761780 where tid>14651;
- update cdb_relatedthreads set tid=tid-16761780 where tid>14651;
- update cdb_rewardlog set tid=tid-16761780 where tid>14651;
- update cdb_rsscaches set tid=tid-16761780 where tid>14651;
- update cdb_sessions set tid=tid-16761780 where tid>14651;
- update cdb_subscriptions set tid=tid-16761780 where tid>14651;
- update cdb_threadsmod set tid=tid-16761780 where tid>14651;
- update cdb_tradelog set tid=tid-16761780 where tid>14651;
- update cdb_trades set tid=tid-16761780 where tid>14651;
将积分1加到积分2上 并清零积分1的sql
- update cdb_members set extcredits1=extcredits1+extcredits2;
- update cdb_members set extcredits1='0';
- update cdb_members set adminid=-1,groupid=特殊用户组ID where lastactivity< unix_timestamp()-300*24*3600
- iptables -I INPUT -p TCP -s 218.0.211.0/24 --dport 80 -j DROP
- select * from cdb_membsers where lastip="IP"
- UPDATE cdb_posts p, cdb_attachments a SET p.attachment=1 WHERE p.pid=a.pid;
更新昨日发贴数
昨日发贴数:
- select count(*) from cdb_posts where dateline>昨天0时的时间戳 and dateline<今天0时的时间戳
- UPDATE `cdb_settings` SET `value` = '昨日发帖数\t1428' WHERE `variable` ='historyposts' LIMIT 1 ;
- update cdb_members set groupid=特殊用户组的id where groupid=新手上路用户组的id and adminid=0
- delete from cdb_posts where fid = '需要删除回复的版块id' and first = 0;
- delete from cdb_forums where fid=23 limit 1;
圈子sgid字段缺少 添加的sql
- ALTER TABLE cdb_threads ADD sgid mediumint(8) unsigned NOT NULL default '0'
- update cdb_threads set replies=(select count(*) from cdb_posts where tid=47708) where tid=47708
关闭所有板块的允许其它模块共享
- update cdb_forums set allowshare=0
- UPDATE `cdb_memberfields` SET `sightml` = ' '
- UPDATE cdb_posts SET subject=REPLACE(subject,'#','楼');
删除一个主题的所有回复
- delete from cdb_posts where tid = '需要删除回复的主题的tid' and first = 0;
- UPDATE `cdb_settings` SET `value` = '1' WHERE CONVERT( `variable` USING utf8 ) = 'thumbstatus' LIMIT 1 ;
- UPDATE `cdb_settings` SET `value` = '2' WHERE CONVERT( `variable` USING utf8 ) = 'thumbstatus' LIMIT 1 ;
批量验证所有未验证的会员
- UPDATE `cdb_members` SET `groupid` = '10' WHERE groupid='8';
- delete from cdb_threads where authorid=0;
- delete from cdb_posts where authorid=0;
- delete from cdb_pms where dateline<1190518730
- update cdb_pms set delstatus=1 where msgfromid=发送者ID
- update cdb_usergroups set allowvote=1 where groupid<4 or groupid>9
- UPDATE `cdb_usergroups` SET `raterange` = '1\t-1\t1\t100\n2\t-1\t1\t100'
图片附件设置正确 但是不直接显示的调整sql:
- update cdb_attachments set `isimage` =1 where SUBSTRING(`filename`,-3,3)='jpg' or SUBSTRING(`filename`,-3,3)='gif'
- update cdb_attachments set remote = '1' where dateline<unix_timestamp()-86400*天数
- update `cdb_usergroups` set `raterange`='扩展积分ID\t评分最小值\t评分最大值\t24小时最大评分数\n扩展积分ID\t评分最小值\t评分最大值\t24小时最大评分数'
- update cdb_activities set tid=tid-16773200 where tid>4009;
- update cdb_activityapplies set tid=tid-16773200 where tid>4009;
- update cdb_attachments set tid=tid-16773200 where tid>4009;
- update cdb_campaigns set tid=tid-16773200 where tid>4009;
- update cdb_debateposts set tid=tid-16773200 where tid>4009;
- update cdb_debates set tid=tid-16773200 where tid>4009;
- update cdb_favorites set tid=tid-16773200 where tid>4009;
- update cdb_forumrecommend set tid=tid-16773200 where tid>4009;
- update cdb_myposts set tid=tid-16773200 where tid>4009;
- update cdb_mythreads set tid=tid-16773200 where tid>4009;
- update cdb_paymentlog set tid=tid-16773200 where tid>4009;
- update cdb_polloptions set tid=tid-16773200 where tid>4009;
- update cdb_polls set tid=tid-16773200 where tid>4009;
- update cdb_posts set tid=tid-16773200 where tid>4009;
- update cdb_relatedthreads set tid=tid-16773200 where tid>4009;
- update cdb_rewardlog set tid=tid-16773200 where tid>4009;
- update cdb_rsscaches set tid=tid-16773200 where tid>4009;
- update cdb_sessions set tid=tid-16773200 where tid>4009;
- update cdb_subscriptions set tid=tid-16773200 where tid>4009;
- update cdb_threads set tid=tid-16773200 where tid>4009;
- update cdb_threadsmod set tid=tid-16773200 where tid>4009;
- update cdb_threadtags set tid=tid-16773200 where tid>4009;
- update cdb_tradelog set tid=tid-16773200 where tid>4009;
- update cdb_trades set tid=tid-16773200 where tid>4009;
- update cdb_typeoptionvars set tid=tid-16773200 where tid>4009;
- update cdb_videos set tid=tid-16773200 where tid>4009;
- update cdb_videotags set tid=tid-16773200 where tid>4009;
- 如果安装了supesite 有了推送主题表还加上:
- update cdb_pushedthreads set tid=tid-16773200 where tid>4009;
批量替换论坛标题内容
- UPDATE `cdb_threads` SET `subject` = replace (`subject`,'需要替换的','替换后的')
- UPDATE `cdb_attachments` SET `thumb` = '0'
- UPDATE `cdb_threads` SET `highlight` = '0'
论坛里所有回复长度小于20的而且没有附件的贴子全部删除掉
- delete from cdb_posts where length(message)<20 and attachment=0
- select * from cdb_attachments where attachment like "%文件名称%"
- update cdb_members set extcredits2=extcredits2+10 where uid in(SELECT authorid FROM `cdb_posts` WHERE tid=主题ID)
- extcredits2 是需要增加的积分字段 , 使用的时候要注意增加的哪个积分字段
- truncate cdb_validating
- UPDATE `cdb_members` SET `oltime` = '0'
把体积大于 819200kb的附件指定为远程附件
- update cdb_attachments set remote = '1' WHERE filesize > 819200
- ALTER TABLE `cdb_threads` CHANGE `tid` `tid` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT;
评论 (0)