﻿{"id":966,"date":"2014-06-09T21:46:05","date_gmt":"2014-06-09T13:46:05","guid":{"rendered":"http:\/\/notes.zerobox.org\/?p=966"},"modified":"2014-06-09T21:48:01","modified_gmt":"2014-06-09T13:48:01","slug":"wordpress-%e6%8a%80%e5%b7%a7%ef%bc%9a%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9-wordpress-%e6%95%b0%e6%8d%ae%e5%ba%93%e5%89%8d%e7%bc%80","status":"publish","type":"post","link":"http:\/\/zerobox.org\/notes\/966.html","title":{"rendered":"WordPress \u6280\u5de7\uff1a\u5982\u4f55\u4fee\u6539 WordPress \u6570\u636e\u5e93\u524d\u7f00"},"content":{"rendered":"<p>&nbsp;<br \/>\n\u5f00\u59cb\u4e4b\u524d<\/p>\n<p>\u4fee\u6539\u6570\u636e\u662f\u4e00\u4ef6\u98ce\u9669\u5f88\u9ad8\u7684\u5de5\u4f5c\uff0c\u5f00\u59cb\u4e4b\u524d\u5fc5\u7136\u5c31\u662f\u505a\u597d\u6570\u636e\u5e93\u5907\u4efd\uff0c\u4e5f\u53ef\u4ee5\u628a\u535a\u5ba2\u8bbe\u7f6e\u4e3a\u7ef4\u62a4\u72b6\u6001\u3002<br \/>\n\u5728 wp-config.php \u4fee\u6539\u6570\u636e\u5e93\u524d\u7f00<\/p>\n<p>\u6253\u5f00\u4f60\u7684 wp-config.php \u6587\u4ef6\uff0c\u628a\u6570\u636e\u5e93\u524d\u7f00 wp_ \u6539\u6210\u4f60\u60f3\u8981\u7684\u524d\u7f00\uff0c\u6bd4\u5982 bug_\u3002<\/p>\n<p>$table_prefix = &#8216;bug_&#8217;;<br \/>\n\u4fee\u6539\u6570\u636e\u8868\u540d\u5b57<\/p>\n<p>\u6253\u5f00 PHPMySQL\uff0c\u627e\u5230\u4f60\u7684\u6570\u636e\u5e93\uff0c\u7136\u540e\u6267\u884c\u4ee5\u4e0b SQL\uff0c\u628a\u6240\u6709\u6570\u636e\u5e93\u8868\u524d\u7f00\u4ece wp_ \u6539\u6210 bug_\u3002<\/p>\n<p>RENAME table `wp_commentmeta` TO `bug_commentmeta`;<br \/>\nRENAME table `wp_comments` TO `bug_comments`;<br \/>\nRENAME table `wp_links` TO `bug_links`;<br \/>\nRENAME table `wp_options` TO `bug_options`;<br \/>\nRENAME table `wp_postmeta` TO `bug_postmeta`;<br \/>\nRENAME table `wp_posts` TO `bug_posts`;<br \/>\nRENAME table `wp_terms` TO `bug_terms`;<br \/>\nRENAME table `wp_term_relationships` TO `bug_term_relationships`;<br \/>\nRENAME table `wp_term_taxonomy` TO `bug_term_taxonomy`;<br \/>\nRENAME table `wp_usermeta` TO `bug_usermeta`;<br \/>\nRENAME table `wp_users` TO `bug_users`;<br \/>\n\u4fee\u6539 Options \u8868\u4e2d\u7684\u6570\u636e<\/p>\n<p>\u4f7f\u7528\u4e0b\u9762\u8bed\u53e5\u628a options \u8868\u4e2d\u7684 option_name \u4ee5 wp_ \u5f00\u5934\u7684\u503c\u6539\u6210 bug_ \u5f00\u5934\u3002<\/p>\n<p>SELECT REPLACE(option_name, &#8216;wp_&#8217;, &#8216;bug_&#8217;) FROM bug_options;<br \/>\n\u4fee\u6539 UserMeta \u8868\u4e2d\u7684\u6570\u636e<\/p>\n<p>\u4f7f\u7528\u4e0b\u9762\u8bed\u53e5\u628a UserMeta \u8868\u4e2d\u7684 meta_key \u4ee5 wp_ \u5f00\u5934\u7684\u503c\u6539\u6210 bug_ \u5f00\u5934\u3002<\/p>\n<p>SELECT REPLACE(meta_key, &#8216;wp_&#8217;, &#8216;bug_&#8217;) FROM bug_usermeta;<br \/>\n\u4fee\u6539\u7528\u6237\u6743\u9650\u914d\u7f6e\u548c\u5176\u4ed6\u7684\u624b\u5c3e\u5de5\u4f5c<\/p>\n<p>\u8fd9\u4e2a\u65f6\u5019\uff0c\u6211\u4eec\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u535a\u5ba2\u4e86\u3002\u6709\u4e9b\u4f4e\u7248\u672c\u7684wordpress\u6709\u53ef\u80fd\u767b\u9646\u4e0d\u4e86\u540e\u53f0\u3002\u8fd9\u65f6\u5019\u65e0\u8bba\u6211\u4eec\u80fd\u5426\u767b\u9646\u540e\u53f0\uff0c\u4ecd\u65e7\u9700\u8981\u8fdb\u884c\u8fd9\u4e00\u6b65\u64cd\u4f5c\u624d\u5b8c\u5584\u3002\u7ee7\u7eed\u6267\u884cSQL\u8bed\u53e5\uff08\u6ce8\u610f\u5c06bug\u66ff\u6362\u6210\u4f60\u60f3\u8981\u4fee\u6539\u7684\u524d\u7f00\uff09\uff1a<\/p>\n<p>UPDATE bug_options SET option_name = REPLACE(option_name, &#8216;wp_user_roles&#8217;, &#8216;bug_user_roles&#8217;);<br \/>\nUPDATE bug_usermeta SET meta_key = REPLACE(meta_key, &#8216;wp_capabilities&#8217;, &#8216;bug_capabilities&#8217;);<br \/>\nUPDATE bug_usermeta SET meta_key = REPLACE(meta_key, &#8216;wp_user_level&#8217;,&#8217;bug_user_level&#8217;);<br \/>\nUPDATE bug_usermeta SET meta_key = REPLACE(meta_key, &#8216;wp_dashboard_quick_press_last_post_id&#8217;, &#8216;bug_dashboard_quick_press_last_post_id&#8217;);<br \/>\nUPDATE bug_usermeta SET option_name = REPLACE(meta_key, &#8216;wp_user-settings&#8217;, &#8216;bug_user-settings&#8217;);<br \/>\nUPDATE bug_usermeta SET meta_key = REPLACE(meta_key, &#8216;wp_user-settings-time&#8217;, &#8216;bug_user-settings-time&#8217;);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u5f00\u59cb\u4e4b\u524d \u4fee\u6539\u6570\u636e\u662f\u4e00\u4ef6\u98ce\u9669\u5f88\u9ad8\u7684\u5de5\u4f5c\uff0c\u5f00\u59cb\u4e4b\u524d\u5fc5\u7136\u5c31\u662f\u505a\u597d\u6570\u636e\u5e93 &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/zerobox.org\/notes\/966.html\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[230],"class_list":["post-966","post","type-post","status-publish","format-standard","hentry","tag-wordpress"],"views":397,"_links":{"self":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/comments?post=966"}],"version-history":[{"count":0,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/966\/revisions"}],"wp:attachment":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media?parent=966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/categories?post=966"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/tags?post=966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}