{"id":153271,"date":"2024-11-02T06:03:22","date_gmt":"2024-11-01T22:03:22","guid":{"rendered":"https:\/\/server.hk\/cnblog\/153271\/"},"modified":"2024-11-02T06:03:22","modified_gmt":"2024-11-01T22:03:22","slug":"%e5%be%9e%e4%bd%8e%e6%95%b8%e6%93%9a%e5%ba%ab%e5%88%b0%e9%ab%98%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9a%e5%ae%8c%e7%be%8e%e7%9a%84%e9%82%84%e5%8e%9f%e4%b9%8b%e8%b7%af-%e4%bd%8e%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/153271\/","title":{"rendered":"\u5f9e\u4f4e\u6578\u64da\u5eab\u5230\u9ad8\u6578\u64da\u5eab\uff1a\u5b8c\u7f8e\u7684\u9084\u539f\u4e4b\u8def (\u4f4e\u6578\u64da\u5eab\u9084\u539f\u9ad8\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"%e5%be%9e%e4%bd%8e%e6%95%b8%e6%93%9a%e5%ba%ab%e5%88%b0%e9%ab%98%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9a%e5%ae%8c%e7%be%8e%e7%9a%84%e9%82%84%e5%8e%9f%e4%b9%8b%e8%b7%af-%e4%bd%8e%e6%95%b8%e6%93%9a%e5%ba%ab-HydizDxOeF\">\u5f9e\u4f4e\u6578\u64da\u5eab\u5230\u9ad8\u6578\u64da\u5eab\uff1a\u5b8c\u7f8e\u7684\u9084\u539f\u4e4b\u8def (\u4f4e\u6578\u64da\u5eab\u9084\u539f\u9ad8\u6578\u64da\u5eab)<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u7ba1\u7406\u548c\u7dad\u8b77\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002\u96a8\u8457\u696d\u52d9\u9700\u6c42\u7684\u589e\u9577\uff0c\u8a31\u591a\u4f01\u696d\u9762\u81e8\u8457\u5f9e\u4f4e\u6578\u64da\u5eab\u5347\u7d1a\u5230\u9ad8\u6578\u64da\u5eab\u7684\u6311\u6230\u3002\u9019\u7bc7\u6587\u7ae0\u5c07\u63a2\u8a0e\u5982\u4f55\u6709\u6548\u5730\u5c07\u4f4e\u6578\u64da\u5eab\u9084\u539f\u5230\u9ad8\u6578\u64da\u5eab\uff0c\u4e26\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u53ef\u7528\u6027\u3002<\/p>\n<h2 id=\"%e4%bd%8e%e6%95%b8%e6%93%9a%e5%ba%ab%e8%88%87%e9%ab%98%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%8d%80%e5%88%a5-HydizDxOeF\">\u4f4e\u6578\u64da\u5eab\u8207\u9ad8\u6578\u64da\u5eab\u7684\u5340\u5225<\/h2>\n<p>\u4f4e\u6578\u64da\u5eab\u901a\u5e38\u6307\u7684\u662f\u5c0f\u578b\u6216\u521d\u5275\u4f01\u696d\u4f7f\u7528\u7684\u6578\u64da\u5eab\uff0c\u9019\u4e9b\u6578\u64da\u5eab\u7684\u6578\u64da\u91cf\u8f03\u5c0f\uff0c\u7d50\u69cb\u76f8\u5c0d\u7c21\u55ae\u3002\u76f8\u5c0d\u800c\u8a00\uff0c\u9ad8\u6578\u64da\u5eab\u5247\u662f\u70ba\u4e86\u8655\u7406\u5927\u91cf\u6578\u64da\u800c\u8a2d\u8a08\u7684\uff0c\u901a\u5e38\u5177\u5099\u66f4\u9ad8\u7684\u6027\u80fd\u548c\u64f4\u5c55\u6027\u3002\u4ee5\u4e0b\u662f\u5169\u8005\u7684\u4e00\u4e9b\u4e3b\u8981\u5340\u5225\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u91cf\uff1a<\/strong>\u4f4e\u6578\u64da\u5eab\u901a\u5e38\u8655\u7406\u7684\u6578\u64da\u91cf\u8f03\u5c0f\uff0c\u800c\u9ad8\u6578\u64da\u5eab\u5247\u80fd\u5920\u8655\u7406TB\u7d1a\u5225\u751a\u81f3PB\u7d1a\u5225\u7684\u6578\u64da\u3002<\/li>\n<li><strong>\u6027\u80fd\uff1a<\/strong>\u9ad8\u6578\u64da\u5eab\u901a\u5e38\u5177\u5099\u66f4\u9ad8\u7684\u8b80\u5beb\u901f\u5ea6\u548c\u66f4\u4f4e\u7684\u5ef6\u9072\uff0c\u80fd\u5920\u652f\u6301\u66f4\u591a\u7684\u4e26\u767c\u7528\u6236\u3002<\/li>\n<li><strong>\u64f4\u5c55\u6027\uff1a<\/strong>\u9ad8\u6578\u64da\u5eab\u8a2d\u8a08\u4e0a\u66f4\u5177\u64f4\u5c55\u6027\uff0c\u80fd\u5920\u96a8\u8457\u696d\u52d9\u9700\u6c42\u7684\u589e\u9577\u800c\u8f15\u9b06\u64f4\u5c55\u3002<\/li>\n<\/ul>\n<h2 id=\"%e9%82%84%e5%8e%9f%e9%81%8e%e7%a8%8b%e7%9a%84%e6%ba%96%e5%82%99%e5%b7%a5%e4%bd%9c-HydizDxOeF\">\u9084\u539f\u904e\u7a0b\u7684\u6e96\u5099\u5de5\u4f5c<\/h2>\n<p>\u5728\u9032\u884c\u4f4e\u6578\u64da\u5eab\u9084\u539f\u5230\u9ad8\u6578\u64da\u5eab\u7684\u904e\u7a0b\u4e2d\uff0c\u6e96\u5099\u5de5\u4f5c\u81f3\u95dc\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u95dc\u9375\u6b65\u9a5f\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u5099\u4efd\uff1a<\/strong>\u5728\u9032\u884c\u4efb\u4f55\u64cd\u4f5c\u4e4b\u524d\uff0c\u52d9\u5fc5\u5c0d\u4f4e\u6578\u64da\u5eab\u9032\u884c\u5b8c\u6574\u7684\u5099\u4efd\u3002\u9019\u6a23\u53ef\u4ee5\u9632\u6b62\u5728\u9084\u539f\u904e\u7a0b\u4e2d\u51fa\u73fe\u610f\u5916\u60c5\u6cc1\u5c0e\u81f4\u6578\u64da\u4e1f\u5931\u3002<\/li>\n<li><strong>\u74b0\u5883\u8a2d\u7f6e\uff1a<\/strong>\u78ba\u4fdd\u9ad8\u6578\u64da\u5eab\u7684\u74b0\u5883\u5df2\u7d93\u8a2d\u7f6e\u59a5\u7576\uff0c\u5305\u62ec\u786c\u4ef6\u914d\u7f6e\u3001\u64cd\u4f5c\u7cfb\u7d71\u548c\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff08DBMS\uff09\u7684\u5b89\u88dd\u3002<\/li>\n<li><strong>\u6578\u64da\u6e05\u7406\uff1a<\/strong>\u5728\u9084\u539f\u4e4b\u524d\uff0c\u5c0d\u4f4e\u6578\u64da\u5eab\u4e2d\u7684\u6578\u64da\u9032\u884c\u6e05\u7406\uff0c\u522a\u9664\u4e0d\u5fc5\u8981\u7684\u6578\u64da\uff0c\u4ee5\u6e1b\u5c11\u5728\u9ad8\u6578\u64da\u5eab\u4e2d\u7684\u5b58\u5132\u9700\u6c42\u3002<\/li>\n<\/ul>\n<h2 id=\"%e9%82%84%e5%8e%9f%e9%81%8e%e7%a8%8b-HydizDxOeF\">\u9084\u539f\u904e\u7a0b<\/h2>\n<p>\u9084\u539f\u904e\u7a0b\u53ef\u4ee5\u5206\u70ba\u5e7e\u500b\u4e3b\u8981\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e6%95%b8%e6%93%9a%e5%b0%8e%e5%87%ba-HydizDxOeF\">1. \u6578\u64da\u5c0e\u51fa<\/h3>\n<p>\u4f7f\u7528\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u5177\uff08\u5982 mysqldump\u3001pg_dump \u7b49\uff09\u5c07\u4f4e\u6578\u64da\u5eab\u4e2d\u7684\u6578\u64da\u5c0e\u51fa\u70ba SQL \u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5c0d\u65bc MySQL \u6578\u64da\u5eab\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>mysqldump -u username -p database_name &gt; backup.sql<\/code><\/pre>\n<h3 id=\"2-%e6%95%b8%e6%93%9a%e8%bd%89%e6%8f%9b-HydizDxOeF\">2. \u6578\u64da\u8f49\u63db<\/h3>\n<p>\u6839\u64da\u9ad8\u6578\u64da\u5eab\u7684\u7d50\u69cb\uff0c\u53ef\u80fd\u9700\u8981\u5c0d\u5c0e\u51fa\u7684\u6578\u64da\u9032\u884c\u8f49\u63db\u3002\u9019\u5305\u62ec\u8abf\u6574\u6578\u64da\u985e\u578b\u3001\u4fee\u6539\u8868\u7d50\u69cb\u7b49\u3002<\/p>\n<h3 id=\"3-%e6%95%b8%e6%93%9a%e5%b0%8e%e5%85%a5-HydizDxOeF\">3. \u6578\u64da\u5c0e\u5165<\/h3>\n<p>\u5c07\u8f49\u63db\u5f8c\u7684\u6578\u64da\u5c0e\u5165\u5230\u9ad8\u6578\u64da\u5eab\u4e2d\u3002\u5c0d\u65bc MySQL\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>mysql -u username -p database_name &lt; backup.sql<\/code><\/pre>\n<h3 id=\"4-%e6%b8%ac%e8%a9%a6%e8%88%87%e9%a9%97%e8%ad%89-HydizDxOeF\">4. \u6e2c\u8a66\u8207\u9a57\u8b49<\/h3>\n<p>\u5728\u5b8c\u6210\u6578\u64da\u5c0e\u5165\u5f8c\uff0c\u9032\u884c\u5168\u9762\u7684\u6e2c\u8a66\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u6b63\u78ba\u6027\u3002\u9019\u5305\u62ec\u6aa2\u67e5\u6578\u64da\u7684\u6e96\u78ba\u6027\u3001\u67e5\u8a62\u6027\u80fd\u7b49\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e6%8c%91%e6%88%b0%e5%8f%8a%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88-HydizDxOeF\">\u5e38\u898b\u6311\u6230\u53ca\u89e3\u6c7a\u65b9\u6848<\/h2>\n<p>\u5728\u5f9e\u4f4e\u6578\u64da\u5eab\u9084\u539f\u5230\u9ad8\u6578\u64da\u5eab\u7684\u904e\u7a0b\u4e2d\uff0c\u53ef\u80fd\u6703\u9047\u5230\u4e00\u4e9b\u6311\u6230\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u4e0d\u4e00\u81f4\uff1a<\/strong>\u5728\u6578\u64da\u5c0e\u51fa\u548c\u5c0e\u5165\u904e\u7a0b\u4e2d\uff0c\u53ef\u80fd\u6703\u51fa\u73fe\u6578\u64da\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\u3002\u89e3\u6c7a\u65b9\u6848\u662f\u9032\u884c\u591a\u6b21\u9a57\u8b49\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<li><strong>\u6027\u80fd\u554f\u984c\uff1a<\/strong>\u9ad8\u6578\u64da\u5eab\u7684\u6027\u80fd\u53ef\u80fd\u6703\u53d7\u5230\u4f4e\u6578\u64da\u5eab\u6578\u64da\u7d50\u69cb\u7684\u5f71\u97ff\u3002\u5efa\u8b70\u5728\u5c0e\u5165\u524d\u9032\u884c\u6027\u80fd\u512a\u5316\u3002<\/li>\n<li><strong>\u517c\u5bb9\u6027\u554f\u984c\uff1a<\/strong>\u4e0d\u540c\u7248\u672c\u7684\u6578\u64da\u5eab\u53ef\u80fd\u5b58\u5728\u517c\u5bb9\u6027\u554f\u984c\uff0c\u5efa\u8b70\u5728\u5347\u7d1a\u524d\u67e5\u95b1\u76f8\u95dc\u6587\u6a94\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-HydizDxOeF\">\u7e3d\u7d50<\/h2>\n<p>\u5f9e\u4f4e\u6578\u64da\u5eab\u9084\u539f\u5230\u9ad8\u6578\u64da\u5eab\u662f\u4e00\u500b\u8907\u96dc\u4f46\u5fc5\u8981\u7684\u904e\u7a0b\u3002\u901a\u904e\u9069\u7576\u7684\u6e96\u5099\u3001\u6709\u6548\u7684\u57f7\u884c\u548c\u5168\u9762\u7684\u6e2c\u8a66\uff0c\u53ef\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u53ef\u7528\u6027\u3002\u96a8\u8457\u696d\u52d9\u7684\u589e\u9577\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u8b8a\u5f97\u81f3\u95dc\u91cd\u8981\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u6216 <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u4f86\u652f\u6301\u60a8\u7684\u6578\u64da\u5eab\u9700\u6c42\uff0c\u8acb\u8003\u616e\u6211\u5011\u7684\u670d\u52d9\u4ee5\u7372\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u5f9e\u4f4e\u6578\u64da\u5eab\u5230\u9ad8\u6578\u64da\u5eab\u7684\u5b8c\u7f8e\u9084\u539f\u4e4b\u8def\uff0c\u63ed\u793a\u6578\u64da\u8f49\u63db\u8207\u6062\u5fa9\u7684\u6700\u4f73\u5be6\u8e10\u8207\u6280\u5de7\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-153271","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=153271"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153271\/revisions"}],"predecessor-version":[{"id":153272,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153271\/revisions\/153272"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=153271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=153271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=153271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}