日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

如何用織夢(mèng)SQL命令行工具操作數(shù)據(jù)庫及常用sql語句整理_DedeCms教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
教大家如何用織夢(mèng)SQL命令行工具操作數(shù)據(jù)庫及常用sql語句整理。
用織夢(mèng)的朋友都知道,如果需要對(duì)數(shù)據(jù)庫進(jìn)行批量操作,可以用織夢(mèng)后臺(tái)【系統(tǒng)】-【sql命令行工具】實(shí)現(xiàn)。其實(shí)這只是織夢(mèng)系統(tǒng)為了大家操作方便,提供的一個(gè)對(duì)mysql數(shù)據(jù)庫操作的工具,這樣大家在需要批量操作數(shù)據(jù)庫時(shí)候可在后臺(tái)直接操作。但是大家在操作數(shù)據(jù)庫時(shí)候一定要小心,最好是先做好數(shù)據(jù)庫備份,以免發(fā)生未知錯(cuò)誤。
下面是織夢(mèng)58小編為大家整理的mysql數(shù)據(jù)庫常用的操作方法,希望大家在用到時(shí)候可以有幫助:
 
sql命令注解:
 
update (表名) set (要修改的 字段名+修改后的 賦值) where (篩選條件)
 
update:是一個(gè)數(shù)據(jù)庫sql語法用語,用途是更新表中原有數(shù)據(jù)
 
where:篩選條件,指你要修改哪些數(shù)據(jù)內(nèi)容,用條件語句篩選提取指定內(nèi)容
 
織夢(mèng)常用的更改SQL命令:
 
織夢(mèng)sql命令批量更改列表頁模板:
  1. update dede_arctype set templist = replace(templist,"{style}/list_qz.htm",'{style}/oz_ongpage.htm') where id in(29,20,31,35,36,37,38,40,41,42,43,44,45,46,47) 
織夢(mèng)sql命令批量更改文章頁模板:
  1. update dede_archives set set temparticle = replace(temparticle,"{style}/article_article_xb.htm",'{style}/article_article.htm'); 
織夢(mèng)sql命令批量更改文章命名規(guī)則:
  1. update `dede_arctype` set namerule='{typedir}/{aid}.html'
注:把站內(nèi)所有文章模型命名規(guī)則全部替換成{typedir}/{aid}.html這樣一種形式
 
織夢(mèng)sql命令批量更改文章點(diǎn)擊數(shù):
 
織夢(mèng)文章可以通過系統(tǒng)設(shè)置》其他選項(xiàng)》文檔默認(rèn)點(diǎn)擊數(shù),修改文章初始的點(diǎn)擊數(shù),如果不修改會(huì)默認(rèn)隨機(jī)顯示文章點(diǎn)擊數(shù)
  1. update `dede_archives` set click=598 
注:更新所有文章的點(diǎn)擊數(shù)為598
  1. update `dede_archives` set click=598 WHERE id=131 
注:表示更新ID131的文檔點(diǎn)擊為598
 
織夢(mèng)sql命令批量替換文章作者:
  1. update dede_archives set writer=replace(writer,'admin','織夢(mèng)58'); 
織夢(mèng)sql命令批量替換文章來源:
  1. update dede_archives set source=replace(source,'未知','織夢(mèng)58'); 
織夢(mèng)sql命令批量替換文章標(biāo)題:
  1. update dede_archives set title=replace(title,'改之前','改之后'); 
例如:我想把標(biāo)題中“織夢(mèng)58”改“seo”:update dede_archives set title=replace(title,'織夢(mèng)58','seo');
 
織夢(mèng)sql命令批量替換文章描述:
  1. update dede_archives set description=replace(description,'原來的關(guān)鍵詞','替換后的關(guān)鍵詞'); 
織夢(mèng)sql命令批量替換文章模型的部分內(nèi)容:
  1. update dede_addonarticle set body=replace(body,'原來的關(guān)鍵詞','替換后的關(guān)鍵詞'); 
注:文章模型也可以變更為圖片模型和軟件模型
 
織夢(mèng)sql命令修改標(biāo)題長(zhǎng)度限制:
 
修改dedecms系統(tǒng)》系統(tǒng)基本參數(shù)》其他選項(xiàng)》文檔標(biāo)題最大長(zhǎng)度為200,改此參數(shù)后需要手工修改數(shù)據(jù)表:
  1. alter table dede_archives modify column title varchar(200) 
織夢(mèng)sql命令批量替換文章模型中內(nèi)容部分超鏈接:
  1. update dede_addonarticle setbody=replace(body,'href="http://www.dede58.com','href="http://dede58.com<span style="font-family: Arial, Verdana, sans-serif;">');</span> 
例如:把文章模型中的超鏈接由原來的http://www.dede58.com替換成http://dede58.com
 
織夢(mèng)sql命令批量審核文章:
  1. update dede_archives set arcrank=0 
注:arcrank=0 僅動(dòng)態(tài)
 
織夢(mèng)sql命令更改縮略圖目錄:
  1. update dede_archives set litpic=replace(litpic,'原來的字符','替換后的字符')  
例如:update dede_archives set litpic=replace(litpic,'uplimg,'tupian')
 
織夢(mèng)批量修改文章動(dòng)態(tài)或靜態(tài)的sql語句
 
將所有文檔設(shè)置為“僅動(dòng)態(tài)”:update dede_archives set ismake=-1
 
將所有文檔設(shè)置為“僅靜態(tài)”:update dede_archives set ismake=1
 
將所有欄目設(shè)置為“使用動(dòng)態(tài)頁”: update dede_arctype set isdefault=-1
 
將所有欄目設(shè)置為“使用靜態(tài)頁”: update dede_arctype set isdefault=1
 
織夢(mèng)常用的刪除SQL命令:
 
如何去掉url中/a/目錄呢?
 
1、首先在系統(tǒng)設(shè)置》系統(tǒng)基本參數(shù),文檔html默認(rèn)保存路徑,把a(bǔ)去掉。
 
2、在dedecms后臺(tái)中sql命令中執(zhí)行下面sql命令,然后重新生成頁面。
 
代碼如下:
  1. update dede_arctype set typedir=replace(typedir,'a/','') 
織夢(mèng)sql命令批量刪除所有文章:
  1. delete from dede_addonarticle where aid>0; 
  2. delete from dede_arctiny where id>0; 
  3. delete from dede_archives where id>0; 
織夢(mèng)sql命令批量刪除某個(gè)id段的文章:
  1. delete from dede_addonarticle where aid >= 100 and aid< =5000; 
  2. delete from dede_arctiny where id >= 100 and id< =5000; 
  3. delete from dede_archives where id >= 100 and id<=5000; 
這段sql命令就是把文章id從100到5000的全部刪除掉
 
織夢(mèng)sql命令批量刪除某個(gè)欄目下文章:
  1. delete from dede_addonimages where typeid = 7
  2. delete from dede_arctiny where typeid = 7
  3. delete from dede_archives where typeid = 7
織夢(mèng)sql命令批量刪除指定欄目:
  1. delete from dede_arctype where id in (93,94,95,96,97) 
注:這段sql命令就是把欄目id為93、94、95、96、97的欄目刪除掉了
 
織夢(mèng)sql命令批量合并文章到指定欄目:
  1. update dede_archives set typeid='70' where typeid in (93,94,95,96,97) 
注:這段sql命令就是把欄目欄目id為93,94,95,96,97里面的文章歸為欄目id為70的欄目下面
 
織夢(mèng)sql命令批量合并欄目到指定欄目為子欄目:
  1. Update `dede_arctype` set reid='目標(biāo)父欄目ID' where id in(2,3,4,5) 
織夢(mèng)sql命令批量清空文章:
  1. delete from dede_addonarticle; 
  2. delete from dede_addonimages; 
  3. delete from dede_archives; 
  4. delete from dede_arctiny; 
  5. delete from dede_co_htmls; 
  6. delete from dede_co_urls; 
  7. delete from dede_co_mediaurls; 
  8. delete from dede_tagindex ; 
  9. delete from dede_taglist; 
  10. delete from dede_keywords; 
注:這段sql命令意思是清空文章和原來采集過的記錄
 
織夢(mèng)新發(fā)布文章id從1開始:
  1. alter table `dede_archives` auto_increment =1
  2. alter table `dede_arctiny` auto_increment =1
  3. alter table `dede_addonarticle` auto_increment =1
織夢(mèng)新發(fā)布欄目id從1開始:
  1. alter table `dede_arctype` auto_increment =1
注:表示新發(fā)布的文章或者欄目id從1開始,數(shù)字1也可以改為指定從任意id開始
僅供大家參考學(xué)習(xí),希望可以幫助到你

查看更多 DedeCms教程  織夢(mèng)模板  織夢(mèng)DedeCms視頻教程  織夢(mèng)dedecms專題

來源:模板無憂//所屬分類:DedeCms教程/更新時(shí)間:2020-04-18
相關(guān)DedeCms教程