{"id":175413,"date":"2024-11-08T05:40:19","date_gmt":"2024-11-07T21:40:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/175413\/"},"modified":"2024-11-08T05:40:19","modified_gmt":"2024-11-07T21:40:19","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8sql%e5%b0%8e%e5%87%ba%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-%e6%95%b8%e6%93%9a%e5%ba%absql%e6%80%8e%e9%ba%bc%e5%b0%8e%e5%87%ba","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/175413\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528SQL\u5c0e\u51fa\u6578\u64da\u5eab\uff1f (\u6578\u64da\u5eabsql\u600e\u9ebc\u5c0e\u51fa)"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8sql%e5%b0%8e%e5%87%ba%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-%e6%95%b8%e6%93%9a%e5%ba%absql%e6%80%8e%e9%ba%bc%e5%b0%8e%e5%87%ba-PxSDXYzWoh\">\u5982\u4f55\u4f7f\u7528SQL\u5c0e\u51fa\u6578\u64da\u5eab\uff1f (\u6578\u64da\u5eabsql\u600e\u9ebc\u5c0e\u51fa)<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u4e2d\uff0c\u5c0e\u51fa\u6578\u64da\u5eab\u662f\u4e00\u9805\u5e38\u898b\u4e14\u91cd\u8981\u7684\u4efb\u52d9\u3002\u7121\u8ad6\u662f\u70ba\u4e86\u5099\u4efd\u6578\u64da\u3001\u9077\u79fb\u6578\u64da\u5eab\uff0c\u9084\u662f\u9032\u884c\u6578\u64da\u5206\u6790\uff0c\u638c\u63e1\u5982\u4f55\u4f7f\u7528SQL\u5c0e\u51fa\u6578\u64da\u5eab\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u6280\u80fd\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5e7e\u7a2e\u5e38\u898b\u7684SQL\u5c0e\u51fa\u65b9\u6cd5\uff0c\u5e6b\u52a9\u60a8\u8f15\u9b06\u5b8c\u6210\u9019\u4e00\u4efb\u52d9\u3002<\/p>\n<h2 id=\"1-%e4%bd%bf%e7%94%a8mysql%e7%9a%84mysqldump%e5%b7%a5%e5%85%b7-PxSDXYzWoh\">1. \u4f7f\u7528MySQL\u7684mysqldump\u5de5\u5177<\/h2>\n<p>mysqldump\u662f\u4e00\u500b\u975e\u5e38\u6d41\u884c\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u65bc\u5c0e\u51faMySQL\u6578\u64da\u5eab\u3002\u5b83\u53ef\u4ee5\u5c07\u6578\u64da\u5eab\u7684\u7d50\u69cb\u548c\u6578\u64da\u5c0e\u51fa\u70baSQL\u6587\u4ef6\uff0c\u65b9\u4fbf\u5f8c\u7e8c\u7684\u5c0e\u5165\u6216\u5099\u4efd\u3002<\/p>\n<h3 id=\"1-1-%e5%9f%ba%e6%9c%ac%e8%aa%9e%e6%b3%95-PxSDXYzWoh\">1.1 \u57fa\u672c\u8a9e\u6cd5<\/h3>\n<pre><code>mysqldump -u [\u7528\u6236\u540d] -p [\u6578\u64da\u5eab\u540d] &gt; [\u5c0e\u51fa\u6587\u4ef6\u540d].sql<\/code><\/pre>\n<p>\u5728\u9019\u88e1\uff0c\u60a8\u9700\u8981\u66ff\u63db\u4ee5\u4e0b\u90e8\u5206\uff1a<\/p>\n<ul>\n<li><strong>[\u7528\u6236\u540d]<\/strong>\uff1a\u60a8\u7684MySQL\u7528\u6236\u540d\u3002<\/li>\n<li><strong>[\u6578\u64da\u5eab\u540d]<\/strong>\uff1a\u60a8\u8981\u5c0e\u51fa\u7684\u6578\u64da\u5eab\u540d\u7a31\u3002<\/li>\n<li><strong>[\u5c0e\u51fa\u6587\u4ef6\u540d]<\/strong>\uff1a\u60a8\u5e0c\u671b\u4fdd\u5b58\u7684\u6587\u4ef6\u540d\u7a31\u3002<\/li>\n<\/ul>\n<h3 id=\"1-2-%e7%a4%ba%e4%be%8b-PxSDXYzWoh\">1.2 \u793a\u4f8b<\/h3>\n<pre><code>mysqldump -u root -p my_database &gt; my_database_backup.sql<\/code><\/pre>\n<p>\u57f7\u884c\u4e0a\u8ff0\u547d\u4ee4\u5f8c\uff0c\u7cfb\u7d71\u6703\u63d0\u793a\u60a8\u8f38\u5165\u5bc6\u78bc\uff0c\u7136\u5f8c\u5c07\u6578\u64da\u5eab\u5c0e\u51fa\u5230\u6307\u5b9a\u7684SQL\u6587\u4ef6\u4e2d\u3002<\/p>\n<h2 id=\"2-%e4%bd%bf%e7%94%a8phpmyadmin%e5%b0%8e%e5%87%ba%e6%95%b8%e6%93%9a%e5%ba%ab-PxSDXYzWoh\">2. \u4f7f\u7528phpMyAdmin\u5c0e\u51fa\u6578\u64da\u5eab<\/h2>\n<p>phpMyAdmin\u662f\u4e00\u500b\u57fa\u65bcWeb\u7684MySQL\u7ba1\u7406\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u53cb\u597d\u7684\u7528\u6236\u754c\u9762\u4f86\u7ba1\u7406\u6578\u64da\u5eab\u3002\u4f7f\u7528phpMyAdmin\u5c0e\u51fa\u6578\u64da\u5eab\u975e\u5e38\u7c21\u55ae\uff0c\u9069\u5408\u4e0d\u719f\u6089\u547d\u4ee4\u884c\u7684\u7528\u6236\u3002<\/p>\n<h3 id=\"2-1-%e6%ad%a5%e9%a9%9f-PxSDXYzWoh\">2.1 \u6b65\u9a5f<\/h3>\n<ol>\n<li>\u767b\u9304\u5230phpMyAdmin\u3002<\/li>\n<li>\u5728\u5de6\u5074\u9762\u677f\u4e2d\u9078\u64c7\u8981\u5c0e\u51fa\u7684\u6578\u64da\u5eab\u3002<\/li>\n<li>\u9ede\u64ca\u4e0a\u65b9\u7684\u201c\u5c0e\u51fa\u201d\u9078\u9805\u3002<\/li>\n<li>\u9078\u64c7\u5c0e\u51fa\u65b9\u6cd5\uff08\u5feb\u901f\u6216\u81ea\u5b9a\u7fa9\uff09\u3002<\/li>\n<li>\u9078\u64c7\u6587\u4ef6\u683c\u5f0f\uff08\u901a\u5e38\u9078\u64c7SQL\uff09\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u57f7\u884c\u201d\u6309\u9215\uff0c\u4e0b\u8f09\u5c0e\u51fa\u7684\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<h2 id=\"3-%e4%bd%bf%e7%94%a8sql-server-management-studio-ssms%e5%b0%8e%e5%87%ba%e6%95%b8%e6%93%9a%e5%ba%ab-PxSDXYzWoh\">3. \u4f7f\u7528SQL Server Management Studio (SSMS)\u5c0e\u51fa\u6578\u64da\u5eab<\/h2>\n<p>\u5c0d\u65bc\u4f7f\u7528Microsoft SQL Server\u7684\u7528\u6236\uff0cSQL Server Management Studio (SSMS)\u63d0\u4f9b\u4e86\u4e00\u500b\u76f4\u89c0\u7684\u754c\u9762\u4f86\u5c0e\u51fa\u6578\u64da\u5eab\u3002<\/p>\n<h3 id=\"3-1-%e6%ad%a5%e9%a9%9f-PxSDXYzWoh\">3.1 \u6b65\u9a5f<\/h3>\n<ol>\n<li>\u6253\u958bSSMS\u4e26\u9023\u63a5\u5230\u6578\u64da\u5eab\u5f15\u64ce\u3002<\/li>\n<li>\u5728\u5c0d\u8c61\u8cc7\u6e90\u7ba1\u7406\u5668\u4e2d\uff0c\u53f3\u9375\u55ae\u64ca\u8981\u5c0e\u51fa\u7684\u6578\u64da\u5eab\u3002<\/li>\n<li>\u9078\u64c7\u201c\u4efb\u52d9\u201d &gt; \u201c\u5c0e\u51fa\u6578\u64da\u201d\u9078\u9805\u3002<\/li>\n<li>\u6309\u7167\u5c0e\u51fa\u56ae\u5c0e\u7684\u6307\u793a\u9032\u884c\u64cd\u4f5c\uff0c\u9078\u64c7\u6578\u64da\u6e90\u548c\u76ee\u6a19\u3002<\/li>\n<li>\u5b8c\u6210\u8a2d\u7f6e\u5f8c\uff0c\u9ede\u64ca\u201c\u5b8c\u6210\u201d\u4ee5\u958b\u59cb\u5c0e\u51fa\u3002<\/li>\n<\/ol>\n<h2 id=\"4-%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-PxSDXYzWoh\">4. \u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u5c0e\u51fa\u6578\u64da\u5eab\u6642\uff0c\u6709\u5e7e\u500b\u6ce8\u610f\u4e8b\u9805\u9700\u8981\u8003\u616e\uff1a<\/p>\n<ul>\n<li>\u78ba\u4fdd\u60a8\u64c1\u6709\u8db3\u5920\u7684\u6b0a\u9650\u4f86\u5c0e\u51fa\u6578\u64da\u5eab\u3002<\/li>\n<li>\u5728\u5c0e\u51fa\u904e\u7a0b\u4e2d\uff0c\u6578\u64da\u5eab\u53ef\u80fd\u6703\u88ab\u9396\u5b9a\uff0c\u5efa\u8b70\u5728\u4f4e\u5cf0\u6642\u6bb5\u9032\u884c\u64cd\u4f5c\u3002<\/li>\n<li>\u5b9a\u671f\u5099\u4efd\u6578\u64da\u5eab\uff0c\u4ee5\u9632\u6578\u64da\u4e1f\u5931\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-PxSDXYzWoh\">\u7e3d\u7d50<\/h2>\n<p>\u5c0e\u51fa\u6578\u64da\u5eab\u662f\u4e00\u9805\u57fa\u672c\u7684\u6578\u64da\u5eab\u7ba1\u7406\u6280\u80fd\uff0c\u7121\u8ad6\u662f\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u5982mysqldump\uff0c\u9084\u662f\u901a\u904e\u5716\u5f62\u754c\u9762\u5de5\u5177\u5982phpMyAdmin\u6216SSMS\uff0c\u90fd\u80fd\u8f15\u9b06\u5b8c\u6210\u3002\u638c\u63e1\u9019\u4e9b\u65b9\u6cd5\u5f8c\uff0c\u60a8\u5c07\u80fd\u5920\u6709\u6548\u5730\u7ba1\u7406\u548c\u5099\u4efd\u60a8\u7684\u6578\u64da\u5eab\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u5b8c\u6574\u6027\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4f86\u6258\u7ba1\u60a8\u7684\u6578\u64da\u5eab\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u7684\u7528\u6236\u3002\u7121\u8ad6\u662f <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u9084\u662f\u5176\u4ed6\u670d\u52d9\uff0c\u6211\u5011\u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528SQL\u5c0e\u51fa\u6578\u64da\u5eab\uff0c\u638c\u63e1\u6578\u64da\u5eab\u5c0e\u51fa\u6280\u5de7\uff0c\u8f15\u9b06\u5099\u4efd\u548c\u8f49\u79fb\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-175413","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/175413","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=175413"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/175413\/revisions"}],"predecessor-version":[{"id":175414,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/175413\/revisions\/175414"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=175413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=175413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=175413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}