{"id":1371,"date":"2017-11-22T12:57:46","date_gmt":"2017-11-22T04:57:46","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=1371"},"modified":"2017-11-22T13:08:56","modified_gmt":"2017-11-22T05:08:56","slug":"%e7%bb%87%e6%a2%a6dedecms%e5%88%a9%e7%94%a8sql%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%b7%a5%e5%85%b7%e6%89%b9%e9%87%8f%e4%bf%ae%e6%94%b9%e6%96%87%e7%ab%a0%e6%9d%a5%e6%ba%90%e3%80%81%e6%97%b6%e9%97%b4%e6%88%96","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/1371.html","title":{"rendered":"\u7ec7\u68a6DEDECMS\u5229\u7528SQL\u547d\u4ee4\u884c\u5de5\u5177\u6279\u91cf\u4fee\u6539\u6587\u7ae0\u6765\u6e90\u3001\u65f6\u95f4\u6216\u4f5c\u8005\u7684\u65b9\u6cd5"},"content":{"rendered":"

dedeCMS\u4fee\u6539mySQL\u8fd8\u662f\u6bd4\u8f83\u65b9\u4fbf\u7684\uff0c<\/p>\n

\u5728dedeCMS\u540e\u53f0\u7684\u7cfb\u7edf\u9009\u9879\u4e2d\u6709\u4e2a\u201cSQL\u547d\u4ee4\u884c\u5de5\u5177\u201d\uff0c<\/p>\n

\u76f4\u63a5\u5728\u8fd0\u884cSQL\u547d\u4ee4\u884c\u9009\u4e2d\u201c\u591a\u884c\u547d\u4ee4\u201d\uff0c\u8f93\u5165SQL\u547d\u4ee4\u6267\u884c\u5c31OK\u4e86\u3002<\/p>\n

\u547d\u4ee4\u683c\u5f0f\uff1a<\/p>\n

update (\u8868\u540d) set (\u8981\u4fee\u6539\u7684 \u5b57\u6bb5\u540d+\u4fee\u6539\u540e\u7684 \u8d4b\u503c) \u00a0where (\u7b5b\u9009\u6761\u4ef6)<\/strong><\/p>\n

\u4f8b1\uff1a\u6279\u91cf\u4fee\u6539\u5df2\u53d1\u6587\u7ae0\u7684\u53d1\u5e03\u65f6\u5019\u548c\u6295\u7a3f\u65f6\u95f4\uff1a<\/p>\n

update dede_archives set pubdate=1504195200 where id>=1;\r\nupdate dede_archives set senddate=1504195200 where id>=1;<\/code><\/pre>\n

SQL\u547d\u4ee4\u8be6\u89e3\uff1a<\/strong><\/p>\n

\u56e0\u4e3a\u7f51\u7ad9\u5df2\u7ecf\u5173\u8054\u4e86\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u6570\u636e\u5e93\u540d\u4e0d\u9700\u8981\u4f53\u73b0\u4e86\u3002<\/p>\n

update\uff1a<\/p>\n

update\u662f\u4e00\u4e2a\u6570\u636e\u5e93SQL\u8bed\u6cd5\u7528\u8bed\uff0c\u7528\u9014\u662f\u66f4\u65b0\u8868\u4e2d\u539f\u6709\u6570\u636e\uff0c\u5355\u72ec\u4f7f\u7528\u65f6\u4f7f\u7528where\u5339\u914d\u5b57\u6bb5\uff08\u6761\u4ef6\u7b5b\u9009\uff09\u3002<\/p>\n

\u8868\u540ddede_archives\uff1a<\/strong><\/p>\n

\u8fd9\u4e2a\u8868\uff0c\u662f\u5b58\u50a8\u6587\u7ae0\u4fe1\u606f\u7684\u8868\uff0cdedeCMS\u7684\u6587\u7ae0\u4fe1\u606f\u597d\u50cf\u662f\u5b58\u653e\u5728\u4e24\u4e2a\u8868\u4e2d\u4e00\u4e2a\u662fdede_archives \u522b\u4e00\u4e2adede_addonarticle(\u6587\u7ae0\u5185\u5bb9\u6240\u6709\u8868)\u3002<\/p>\n

\u5982\u679c\u4f60\u4e0d\u77e5\u9053\u6570\u636e\u5e93\u7ed3\u6784\uff0c\u53ef\u4ee5\u901a\u8fc7phpMyAdmin\u53bb\u67e5\u770bSQL\u7684\u5185\u5bb9\u5c31\u53ef\u4ee5\u63a8\u65ad\u3002<\/p>\n

\u5982\u679cphpMyAdmin\u4e0d\u4f1a\u7528\uff0c\u6216\u6ca1\u6743\u9650\u4f7f\u7528\uff0c\u5c31\u53bb\u95ee\u5ea6\u5a18\u5427\u3002\u6216\u7528\u5176\u5b83\u5de5\u5177\u67e5\u770b\uff0c\u53cd\u6b63\u4f60\u77e5\u9053\u6570\u636e\u5e93\u540d\u548c\u5bc6\u7801\uff0c\u53bb\u6298\u817e\u5427\u3002<\/p>\n

dedeCMS\u7684\u5b98\u7f51\u597d\u50cf\u6709\u6570\u636e\u5e93\u7ed3\u6784\u4ecb\u7ecd\uff0c\u53ef\u4ee5\u53bb\u770b\u770b\u3002<\/p>\n

\u5bf9\u4e86\uff0c\u5f88\u591a\u5c0f\u767d\u8bf4\u4e0d\u77e5\u9053\u81ea\u5df1\u7684\u6570\u636e\u5e93\u540d\uff0c\u867d\u7136\u8fd9\u91cc\u4e0d\u4f1a\u7528\u5230\uff0c\u4e5f\u63d0\u4e00\u5634\uff0c<\/p>\n

\u53ef\u4ee5\u67e5\u770b\u4f60\u7684\u5907\u7f6e\u6587\u4ef6\uff1a\u5982dedeCMS\u7684\uff1a\u5c31\u53bb\u67e5\u770bdada\u4e0b\u7684common.inc.php\u6587\u4ef6\u3002\u6bcf\u4e2aCMS\u90fd\u6709\u8fd9\u6837\u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

\u5b57\u6bb5\u540dpubdate\u548csendtate\uff1a<\/strong><\/p>\n

\u5b57\u6bb5\u540d\u5e94\u8be5\u662f\u4f60\u6240\u9009\u62e9\u7684\u8868\u540d\u4e0b\u7684\u5b57\u6bb5\u7ed3\u6784\u3002
\n<\/strong><\/p>\n

\u8fd9\u91cc\u7684pubdate\u662f\u6307\u53d1\u5e03\u65f6\u95f4\uff0c\u4e5f\u53ef\u80fd\u662f\u53d1\u8868\u65f6\u95f4\u6216\u66f4\u65b0\u65f6\u95f4\uff0c\u5373\u6211\u4eec\u6240\u80fd\u770b\u5230\u7684\u6587\u7ae0\u53d1\u8868\u7684\u65f6\u95f4\u3002<\/p>\n

\u8fd9\u91cc\u7684senddate\u662f\u6307\u6295\u7a3f\u65f6\u95f4\uff0c\u5373\u9996\u6b21\u5199\u5165\u6570\u636e\u5e93\u7684\u65f6\u95f4\u3002<\/p>\n

\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4f60\u4e0b\u8f7d\u7684\u6e90\u7801\u6216cms\uff0c\u6240\u53d1\u8868\u6587\u7ae0\u7684\u65f6\u95f4\u5f15\u7528\u4e0d\u540c\uff0c\u800c\u6211\u4eec\u5728\u524d\u7aef\u80fd\u770b\u5230\u7684\u65f6\u95f4\u4e5f\u5c31\u4f1a\u6709\u6240\u4e0d\u540c\uff0c<\/p>\n

\u6bd4\u5982\uff0c\u6709\u4e9b\u7ad9\u70b9\u662f\u5f15\u7528senddate\u505a\u4e3a\u524d\u7aef\u9875\u9762\u80fd\u770b\u5230\u7684\u201c\u53d1\u5e03\u65f6\u95f4\u201d\uff0c\u90a3\u4e48\u8fd9\u4e2a\u65f6\u95f4\u53ef\u80fd\u4f60\u5728\u540e\u53f0\u4fee\u6539\u5185\u5bb9\u91cd\u65b0\u53d1\u5e03\u540e\uff0c\u524d\u7aef\u7684\u65f6\u95f4\u4e0d\u4f1a\u88ab\u4fee\u6539\u6210\u5f53\u524d\u65f6\u95f4\u3002<\/p>\n

\u5b9a\u4e49\u4e0d\u540c\uff0c\u5f15\u7528\u4e0d\u540c\uff0c\u65f6\u95f4\u4f1a\u4e0d\u4f1a\u6539\u53d8\u4e5f\u5c31\u4e0d\u540c\uff0c\u53cd\u6b63\u4f60\u77e5\u9053\u8fd9\u4e2a\u7406\u5c31\u884c\u4e86\u3002\u5b57\u6bb5\u540d\u4ec5\u4ec5\u662f\u53d6\u4e86\u4e2a\u540d\u5b57\u800c\u5df1\uff0c\u5177\u4f53\u95ee\u9898\u9700\u5177\u4f53\u5206\u6790\u3002<\/p>\n

Unix\u65f6\u95f4\u6233\uff1a<\/p>\n

\u8fd9\u91cc\u6709\u4e2a\u6982\u5ff5\uff0c\u65f6\u95f4\u6233\u3002\u5728SQL\u4e2d\u4fee\u6539\u7684\u65f6\u95f4\u8981\u7528\u5230\u65f6\u95f4\u6233\u3002\u5176\u5b9e\u5b83\u5c31\u662f\u4e00\u4e2a\u4ee5\u201c\u79d2\u201d\u8ba1\u6570\u7684\u503c\u3002\u5176\u5b83\u522b\u95ee\u6211\uff0c\u6211\u4e5f\u4e0d\u61c2\u3002\u6211\u662f\u5927\u767d\u3002<\/p>\n

\u53ea\u9700\u77e5\u9053\u5728\u547d\u4ee4\u4e2d\u4fee\u6539\u65f6\u95f4\u90fd\u8981\u7528\u65f6\u95f4\u6233\u65b9\u5f0f\u3002<\/p>\n

\u5176\u8f6c\u6362\u53ef\u4ee5\u770b\u8fd9\u4e2a\u5de5\u5177\uff1ahttp:\/\/tool.chinaz.com\/Tools\/unixtime.aspx<\/p>\n

where (\u7b5b\u9009\u6761\u4ef6)\uff1a<\/strong><\/p>\n

\u8fd9\u4e2a\u5c31\u662f\u5b57\u9762\u610f\u601d\uff0c\u6307\u4f60\u8981\u4fee\u6539\u54ea\u4e9b\u6570\u636e\u5185\u5bb9\uff0c\u7528\u6761\u4ef6\u8bed\u53e5\u7b5b\u9009\u63d0\u53d6\u6307\u5b9a\u5185\u5bb9\u3002<\/p>\n

\u50cf\u4f8b\u4e2d\u7684\u6761\u4ef6\u662f id>=1\uff0c\u5c31\u662f\u6211\u6240\u8981\u4fee\u6539\u65f6\u95f4\u7684\u6570\u636e\u9700\u8981\u6ee1\u8db3id\u53f7\u5927\u4e8e1\u7684\u5185\u5bb9\u3002<\/p>\n

\u5982\u679c\u6761\u4ef6\u662fid>=5\uff0c\u90a3\u4e48id\u53f7\u5c0f\u4e8e\u7b49\u4e8e5\u7684\u6570\u636e\u5c31\u6ca1\u6709\u88ab\u9009\u4e2d\u4fee\u6539\uff01<\/p>\n

\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u4e0a\u4f8b\u4e2d\uff1aid\u8fd9\u4e2a\u5b57\u6bb5\u540d\u9700\u8981\u5728dede_archives\u8868\u4e2d\u5b58\u5728\uff01<\/p>\n

\u50cfdede_archives\u8868\u4e2d\u5b57\u6bb5\u540d\u6709\uff1a<\/p>\n

writer \u00a0\u4f5c\u8005<\/p>\n

source \u6587\u7ae0\u6765\u6e90<\/p>\n

typeid \u680f\u76eeID\u53f7<\/p>\n

\u2026\u2026<\/p>\n

\u8fd9\u4e0a\u7ed3\u6761\u4ef6\u7b5b\u9009\u90fd\u53ef\u4ee5\u7528\u4e0a\u3002\u7075\u6d3b\u7684\u5f88\u3002<\/p>\n

\u6269\u5c55\u80fd\u529b\uff1a<\/strong><\/p>\n

\u76ee\u6807\uff1a\u4e0d\u4f46dedeCMS\u6570\u636e\u5e93\u4f60\u80fd\u6279\u7406\u4fee\u6539\uff0c\u6240\u6709\u7684SQL\u4f60\u90fd\u53ef\u4ee5\u6279\u91cf\u4fee\u6539\uff01<\/p>\n

1\u3001\u4e86\u89e3\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u7684\u7ed3\u6784\u3002<\/p>\n

dedeCMS\u7684\u5728\u540e\u53f0\u7cfb\u7edf\u4e2d\u7684\u201cSQL\u547d\u4ee4\u884c\u5de5\u5177\u201d\u6709\u4e2a\u6570\u636e\u5e93\u7ed3\u6784\u67e5\u770b\u529f\u80fd\u3002\u6587\u672c\u6846\u4e2d\u7684\u5c31\u662f\u6240\u6709\u6570\u636e\u5e93\u8868\u540d\uff0c\u9009\u4e2d\u8868\u540d\u70b9\u53f3\u8fb9\u7684\u201c\u67e5\u770b\u8868\u7ed3\u6784\u201d\u53ef\u770b\u5230\u7b2c\u4e00\u6392\u7684\u662f\u5b57\u6bb5\u540d\u3002\u540e\u9762\u8ddf\u7740\u7684\u662f\u7c7b\u578b\u957f\u5ea6\u7b49\u5b9a\u4e49\u3002<\/p>\n

\u5176\u5b83CMS\u53ef\u901a\u8fc7phpMyAdmin\u7b49\u5de5\u5177\u53bb\u67e5\u770b\u5206\u6790\u8868\u7ed3\u6784\u3002\u6216\u770b\u76f8\u5e94\u7684CMS\u7cfb\u7edf\u7684\u5b98\u65b9\u4ecb\u7ecd\u3002<\/p>\n

\u8fd8\u6709\u5c31\u662f\u767e\u5ea6\uff0c\u4f46\u6709\u4e9b\u4e8c\u6b21\u5f00\u53d1\u7684\u6e90\u7801\u4f1a\u5bf9\u6570\u636e\u8868\u8fdb\u884c\u4fee\u6539\u6dfb\u52a0\u7b49\uff0c\u90a3\u5c31\u8981\u6ce8\u610f\u4e86\uff0c\u5b83\u5c31\u662f\u975e\u6807\u51c6\u7684\u4e86\uff01<\/p>\n

2\u3001\u6e05\u695a\u4f60\u6240\u8981\u4fee\u6539\u7684\u6bb5\u5b57\u5185\u5bb9\u7684\u6570\u636e\u7c7b\u578b\u3002<\/p>\n

\u662f\u5b57\u7b26\u4e32\u578b\u7684\uff0c\u4f60\u7684set\u540e\u9762\u5c31\u8981\u662f\u5b57\u7b26\u7c7b\u578b\uff0c\u5982\uff1aset witer =\"qoogle\" \u8fd9\u662f\u4f5c\u8005\uff0c\u662f\u5b57\u7b26\u4e32\uff0c\u8981\u7528\u5f15\u53f7\u3002<\/p>\n

\u662f\u4ec0\u4e48\u7c7b\u578b\u7684\u6570\u636e\u5c31\u8981\u5339\u914d\u76f8\u5e94\u7684\u7c7b\u578b\uff0c\u5426\u5219\u7f51\u7ad9\u53d8\u4f1a\u51fa\u9519\uff01<\/p>\n

3\u3001\u547d\u4ee4\u5728\u54ea\u8f93\u5165\uff1f<\/p>\n

dedeCMS\u5728\u540e\u53f0\u6709\uff0c\u5176\u5b83\u7684CMS\u4e0d\u4e00\u5b9a\u6709\u3002\u90a3\u4e48\u60a8\u53ef\u4ee5\u7528phpMyAdmin\u6216\u5176\u5b83\u7684\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\u3002<\/p>\n

dedeCMS\u540e\u53f0\u7684\u201c\u91c7\u96c6\u201d\u91cc\u7684\u201c\u6279\u91cf\u7ef4\u62a4\u201d\u4e2d\u6709\u4e2a\u201c\u6570\u636e\u5e93\u5185\u5bb9\u66ff\u6362\u201d\uff0c\u76f8\u5f53\u4e8e\u662fupdate\u547d\u4ee4\u7684\u767d\u8bdd\u6587\u4e86\u3002\u672c\u4eba\u6ca1\u7528\u8fc7\uff01\u4e0d\u6e05\u695a\u5b83\u7684\u201c\u88ab\u66ff\u6362\u5185\u5bb9\u201d\u662f\u4e0d\u662f\u4e00\u5b9a\u8981\u5199\uff1f\u5426\u5219\u4e0d\u80fd\u5b8c\u6210\u4e00\u6b21\u6027\u6279\u91cf\u4fee\u6539\u3002<\/p>\n

4\u3001\u5b66\u4e00\u70b9\u70b9SQL\u547d\u4ee4\u64cd\u4f5c\uff0c\u5bf9\u5efa\u7ad9\u8fd8\u662f\u5f88\u6709\u597d\u5904\u7684\u3002<\/p>\n

\u2026\u2026<\/p>\n

\u4e3e\u4e00\u53cd\u4e09\uff1a<\/strong><\/p>\n

dede\u4f8b2\uff1a<\/strong><\/p>\n

\u6240\u6709\u6587\u7ae0\u7684\u4f5c\u8005\u6279\u91cf\u4fee\u6539\u6210baishitou\uff1a<\/p>\n

update dede_archives set writer=\"baishitou\" where id>=1;<\/code><\/pre>\n

dede\u4f8b3\uff1a<\/strong><\/p>\n

\u4f5c\u8005\u4e3a\u201c\u7ba1\u7406\u5458\u201d\u7684\u6587\u7ae0\u7684\u4f5c\u8005\u6279\u91cf\u4fee\u6539\u6210baishitou\uff1a<\/p>\n

update dede_archives set writer=\"baishitou\" where writer=\"\u7ba1\u7406\u5458\";<\/code><\/pre>\n

dede\u4f8b4\uff1a<\/strong><\/p>\n

\u6279\u91cf\u4fee\u6539\u680f\u76eeID\u53f7\u7b49\u4e8e1\u7684\u6587\u7ae0\u4f5c\u8005\u4e3a\u201cbaishitou\uff1a<\/p>\n

update dede_archives set writer=\"baishitou\" where typeid=1;<\/code><\/pre>\n

dede\u4f8b5\uff1a<\/strong><\/p>\n

\u6279\u91cf\u4fee\u6539\u6240\u6709\u6587\u7ae0\u7684\u6765\u6e90\u4e3awww.baishitou.cn\uff1a<\/p>\n

update dede_archives set source=\"www.baishitou.cn\" where id>=1;<\/code><\/pre>\n

dede\u4f8b6\uff1a<\/strong><\/p>\n

\u6279\u91cf\u591a\u4e2a\u5b57\u6bb5\u66f4\u65b0\u3001\u591a\u4e2a\u6761\u4ef6\u7b5b\u9009\u65b9\u6cd5\uff1a<\/p>\n

\u62ff\u4f8b1\u6765\u8bf4\u4e8b\uff1a<\/p>\n

\u4f8b1\u539f\u6765\u662f\u8fd9\u7684\uff1a<\/p>\n

update dede_archives set pubdate=1504195200 where id>=1;\r\nupdate dede_archives set senddate=1504195200 where id>=1;<\/code><\/pre>\n

\u53ef\u6539\u4e3a\uff1a\u6ce8\u610f\u591a\u4e2aset\u503c\u7528\u82f1\u6587\u9017\u53f7\u9694\u5f00\uff01\uff01\u9017\u53f7\uff0c\u9017\u53f7\uff0c\u9017\u53f7\uff01<\/p>\n

update dede_archives set pubdate=1504195200,senddate=1504195200 where id>=1;<\/code><\/pre>\n

\u53ef\u53bb\u9664where\u7b5b\u9009\u6761\u4ef6\uff0c\u5373\u4fee\u6539\u6574\u4e2adede_archives\u8868\u7684\u6240\u6709pubdate\u503c\uff1a<\/p>\n

update dede_archives set pubdate=1504195200,senddate=1504195200;<\/code><\/pre>\n

\u591awhere\u6761\u4ef6\u4fee\u6539\uff1a\u6ce8\u610f\uff0c\u591a\u4e2awhere\u503c\u7528\u903b\u8f91\u8fd0\u7b97\u7b26\uff1aand \u548c or<\/p>\n

update dede_archives set writer=\"baishitou\",ource=\"www.baishitou.cn\" where typeid=20 or writer=\"\u767d\u77f3\u5934\";<\/code><\/pre>\n

\u903b\u8f91\u8fd0\u7b97\u7b26\u89e3\u91ca\uff1a<\/p>\n

and\uff1a\u662f\u6761\u4ef61\u548c\u6761\u4ef62\u8fd9\u4e24\u4e2a\u6761\u4ef6\u9700\u8981\u540c\u65f6\u6ee1\u8db3\u624d\u4f1a\u4fee\u6539\uff01<\/p>\n

or\uff1a\u662f\u53ea\u9700\u6ee1\u8db3\u4efb\u4f55\u4e00\u4e2a\u90fd\u4f1a\u6267\u884c\u4fee\u6539\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

dedeCMS\u4fee\u6539mySQL\u8fd8\u662f\u6bd4\u8f83\u65b9\u4fbf\u7684\uff0c \u5728dedeCMS\u540e\u53f0\u7684\u7cfb\u7edf\u9009\u9879\u4e2d\u6709\u4e2a\u201cSQL\u547d\u4ee4\u884c\u5de5\u5177\u201d\uff0c \u76f4\u63a5 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[43,406,407,180],"class_list":["post-1371","post","type-post","status-publish","format-standard","hentry","category-web","tag-dedecms","tag-sql","tag-407","tag-180"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=1371"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1371\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=1371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=1371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=1371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}