{"id":190150,"date":"2024-11-12T10:11:19","date_gmt":"2024-11-12T02:11:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/190150\/"},"modified":"2024-11-12T10:11:20","modified_gmt":"2024-11-12T02:11:20","slug":"%e7%b6%b2%e9%a0%81%e6%95%b8%e6%93%9a%e5%ba%ab%e6%98%af%e5%90%a6%e5%8f%af%e4%bb%a5%e5%b0%8e%e5%87%ba%ef%bc%9f-%e7%b6%b2%e9%a0%81%e6%95%b8%e6%93%9a%e5%ba%ab%e8%83%bd%e5%90%a6%e5%b0%8e%e5%87%ba","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/190150\/","title":{"rendered":"\u7db2\u9801\u6578\u64da\u5eab\u662f\u5426\u53ef\u4ee5\u5c0e\u51fa\uff1f (\u7db2\u9801\u6578\u64da\u5eab\u80fd\u5426\u5c0e\u51fa)"},"content":{"rendered":"<h1 id=\"%e7%b6%b2%e9%a0%81%e6%95%b8%e6%93%9a%e5%ba%ab%e6%98%af%e5%90%a6%e5%8f%af%e4%bb%a5%e5%b0%8e%e5%87%ba%ef%bc%9f-aWtsSYOEji\">\u7db2\u9801\u6578\u64da\u5eab\u662f\u5426\u53ef\u4ee5\u5c0e\u51fa\uff1f<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u4f4d\u5316\u7684\u6642\u4ee3\uff0c\u6578\u64da\u5eab\u5df2\u6210\u70ba\u7db2\u7ad9\u904b\u71df\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u3002\u7121\u8ad6\u662f\u96fb\u5b50\u5546\u52d9\u5e73\u53f0\u3001\u793e\u4ea4\u5a92\u9ad4\u7db2\u7ad9\u9084\u662f\u5167\u5bb9\u7ba1\u7406\u7cfb\u7d71\uff0c\u6578\u64da\u5eab\u90fd\u5728\u80cc\u5f8c\u652f\u6301\u8457\u6578\u64da\u7684\u5b58\u5132\u548c\u7ba1\u7406\u3002\u7136\u800c\uff0c\u8a31\u591a\u7db2\u7ad9\u7ba1\u7406\u8005\u5728\u9762\u5c0d\u6578\u64da\u5eab\u6642\uff0c\u5e38\u5e38\u6703\u6709\u4e00\u500b\u554f\u984c\uff1a\u7db2\u9801\u6578\u64da\u5eab\u662f\u5426\u53ef\u4ee5\u5c0e\u51fa\uff1f\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u4e00\u554f\u984c\uff0c\u4e26\u63d0\u4f9b\u76f8\u95dc\u7684\u89e3\u7b54\u548c\u793a\u4f8b\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e7%b6%b2%e9%a0%81%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-aWtsSYOEji\">\u4ec0\u9ebc\u662f\u7db2\u9801\u6578\u64da\u5eab\uff1f<\/h2>\n<p>\u7db2\u9801\u6578\u64da\u5eab\u662f\u6307\u7528\u65bc\u5b58\u5132\u548c\u7ba1\u7406\u7db2\u7ad9\u6578\u64da\u7684\u7cfb\u7d71\u3002\u5e38\u898b\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u5305\u62ec MySQL\u3001PostgreSQL\u3001MongoDB \u7b49\u3002\u9019\u4e9b\u6578\u64da\u5eab\u80fd\u5920\u9ad8\u6548\u5730\u8655\u7406\u5927\u91cf\u6578\u64da\uff0c\u4e26\u652f\u6301\u591a\u7a2e\u67e5\u8a62\u548c\u64cd\u4f5c\u3002\u7db2\u7ad9\u7684\u6578\u64da\uff0c\u5982\u7528\u6236\u4fe1\u606f\u3001\u7522\u54c1\u8cc7\u6599\u3001\u6587\u7ae0\u5167\u5bb9\u7b49\uff0c\u901a\u5e38\u90fd\u5b58\u5132\u5728\u9019\u4e9b\u6578\u64da\u5eab\u4e2d\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e5%b0%8e%e5%87%ba%e7%9a%84%e5%bf%85%e8%a6%81%e6%80%a7-aWtsSYOEji\">\u6578\u64da\u5eab\u5c0e\u51fa\u7684\u5fc5\u8981\u6027<\/h2>\n<p>\u6578\u64da\u5eab\u5c0e\u51fa\u662f\u6307\u5c07\u6578\u64da\u5eab\u4e2d\u7684\u6578\u64da\u8f49\u63db\u70ba\u53ef\u79fb\u52d5\u6216\u53ef\u5099\u4efd\u7684\u683c\u5f0f\u3002\u9019\u4e00\u904e\u7a0b\u5c0d\u65bc\u7db2\u7ad9\u7ba1\u7406\u8005\u4f86\u8aaa\u81f3\u95dc\u91cd\u8981\uff0c\u539f\u56e0\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u5099\u4efd\uff1a<\/strong>\u5b9a\u671f\u5c0e\u51fa\u6578\u64da\u5eab\u53ef\u4ee5\u4f5c\u70ba\u6578\u64da\u5099\u4efd\uff0c\u9632\u6b62\u6578\u64da\u4e1f\u5931\u3002<\/li>\n<li><strong>\u6578\u64da\u9077\u79fb\uff1a<\/strong>\u7576\u9700\u8981\u5c07\u7db2\u7ad9\u5f9e\u4e00\u500b\u4f3a\u670d\u5668\u9077\u79fb\u5230\u53e6\u4e00\u500b\u4f3a\u670d\u5668\u6642\uff0c\u5c0e\u51fa\u6578\u64da\u5eab\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u6b65\u9a5f\u3002<\/li>\n<li><strong>\u6578\u64da\u5206\u6790\uff1a<\/strong>\u5c0e\u51fa\u7684\u6578\u64da\u53ef\u4ee5\u7528\u65bc\u9032\u4e00\u6b65\u7684\u5206\u6790\u548c\u5831\u544a\uff0c\u5e6b\u52a9\u7db2\u7ad9\u7ba1\u7406\u8005\u505a\u51fa\u66f4\u660e\u667a\u7684\u6c7a\u7b56\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e5%b0%8e%e5%87%ba%e7%b6%b2%e9%a0%81%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-aWtsSYOEji\">\u5982\u4f55\u5c0e\u51fa\u7db2\u9801\u6578\u64da\u5eab\uff1f<\/h2>\n<p>\u5c0e\u51fa\u7db2\u9801\u6578\u64da\u5eab\u7684\u5177\u9ad4\u65b9\u6cd5\u53d6\u6c7a\u65bc\u6240\u4f7f\u7528\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u6578\u64da\u5eab\u5c0e\u51fa\u65b9\u6cd5\uff1a<\/p>\n<h3 id=\"1-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab%e5%b0%8e%e5%87%ba-aWtsSYOEji\">1. MySQL \u6578\u64da\u5eab\u5c0e\u51fa<\/h3>\n<p>\u5c0d\u65bc\u4f7f\u7528 MySQL \u7684\u7db2\u7ad9\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u884c\u5de5\u5177\u9032\u884c\u5c0e\u51fa\uff1a<\/p>\n<pre><code>mysqldump -u username -p database_name &gt; output_file.sql<\/code><\/pre>\n<p>\u5728\u9019\u88e1\uff0c`username` \u662f\u6578\u64da\u5eab\u7528\u6236\u540d\uff0c`database_name` \u662f\u8981\u5c0e\u51fa\u7684\u6578\u64da\u5eab\u540d\u7a31\uff0c`output_file.sql` \u662f\u5c0e\u51fa\u5f8c\u7684\u6587\u4ef6\u540d\u3002\u57f7\u884c\u6b64\u547d\u4ee4\u5f8c\uff0c\u7cfb\u7d71\u6703\u63d0\u793a\u8f38\u5165\u5bc6\u78bc\uff0c\u7136\u5f8c\u5c07\u6578\u64da\u5eab\u5c0e\u51fa\u70ba SQL \u6587\u4ef6\u3002<\/p>\n<h3 id=\"2-postgresql-%e6%95%b8%e6%93%9a%e5%ba%ab%e5%b0%8e%e5%87%ba-aWtsSYOEji\">2. PostgreSQL \u6578\u64da\u5eab\u5c0e\u51fa<\/h3>\n<p>\u5c0d\u65bc PostgreSQL\uff0c\u7528\u6236\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>pg_dump -U username -W -F t database_name &gt; output_file.tar<\/code><\/pre>\n<p>\u9019\u88e1\u7684\u53c3\u6578\u8207 MySQL \u985e\u4f3c\uff0c`-F t` \u8868\u793a\u4ee5 tar \u683c\u5f0f\u5c0e\u51fa\u3002<\/p>\n<h3 id=\"3-%e4%bd%bf%e7%94%a8%e5%9c%96%e5%bd%a2%e7%95%8c%e9%9d%a2%e5%b7%a5%e5%85%b7-aWtsSYOEji\">3. \u4f7f\u7528\u5716\u5f62\u754c\u9762\u5de5\u5177<\/h3>\n<p>\u9664\u4e86\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u8a31\u591a\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u9084\u63d0\u4f9b\u5716\u5f62\u754c\u9762\u5de5\u5177\uff0c\u5982 phpMyAdmin \u548c pgAdmin\uff0c\u9019\u4e9b\u5de5\u5177\u901a\u5e38\u63d0\u4f9b\u7c21\u55ae\u7684\u5c0e\u51fa\u9078\u9805\uff0c\u4f7f\u7528\u8005\u53ea\u9700\u9078\u64c7\u8981\u5c0e\u51fa\u7684\u6578\u64da\u5eab\uff0c\u7136\u5f8c\u9078\u64c7\u5c0e\u51fa\u683c\u5f0f\u5373\u53ef\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-aWtsSYOEji\">\u7d50\u8ad6<\/h2>\n<p>\u7e3d\u7684\u4f86\u8aaa\uff0c\u7db2\u9801\u6578\u64da\u5eab\u662f\u53ef\u4ee5\u5c0e\u51fa\u7684\uff0c\u9019\u4e00\u904e\u7a0b\u5c0d\u65bc\u6578\u64da\u5099\u4efd\u3001\u9077\u79fb\u548c\u5206\u6790\u90fd\u81f3\u95dc\u91cd\u8981\u3002\u7121\u8ad6\u662f\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u9084\u662f\u5716\u5f62\u754c\u9762\u5de5\u5177\uff0c\u7db2\u7ad9\u7ba1\u7406\u8005\u90fd\u61c9\u8a72\u5b9a\u671f\u9032\u884c\u6578\u64da\u5eab\u7684\u5c0e\u51fa\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u53ef\u7528\u6027\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u4f86\u652f\u6301\u60a8\u7684\u7db2\u7ad9\u904b\u71df\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u7684\u5ba2\u6236\u3002\u7121\u8ad6\u662f\u6578\u64da\u5eab\u7ba1\u7406\u9084\u662f\u7db2\u7ad9\u6027\u80fd\u512a\u5316\uff0c\u6211\u5011\u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u7db2\u9801\u6578\u64da\u5eab\u662f\u5426\u53ef\u4ee5\u5c0e\u51fa\uff0c\u63a2\u7d22\u5c0e\u51fa\u65b9\u6cd5\u53ca\u5176\u61c9\u7528\uff0c\u52a9\u60a8\u6709\u6548\u7ba1\u7406\u548c\u5229\u7528\u6578\u64da\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-190150","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/190150","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=190150"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/190150\/revisions"}],"predecessor-version":[{"id":190151,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/190150\/revisions\/190151"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=190150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=190150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=190150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}