{"id":6563,"date":"2024-11-14T15:18:55","date_gmt":"2024-11-14T07:18:55","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6563\/"},"modified":"2024-11-14T15:18:55","modified_gmt":"2024-11-14T07:18:55","slug":"mysql%e6%80%8e%e4%b9%88%e6%8a%8a%e6%95%b0%e6%8d%ae%e5%ba%93%e6%95%b0%e6%8d%ae%e5%af%bc%e5%87%ba","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6563\/","title":{"rendered":"mysql\u600e\u4e48\u628a\u6570\u636e\u5e93\u6570\u636e\u5bfc\u51fa"},"content":{"rendered":"<blockquote><p>\n  \u8981\u5bfc\u51fa mysql \u6570\u636e\u5e93\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\u884c\u5de5\u5177\u5bfc\u51fa\u6570\u636e\u4f7f\u7528 mysql workbench \u56fe\u5f62\u754c\u9762\u5bfc\u51fa\u6570\u636e\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\u5bfc\u51fa\u6570\u636e\uff0c\u4f8b\u5982 phpmyadmin\u3001navicat \u6216 sqlyog\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520282427511.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u628a\u6570\u636e\u5e93\u6570\u636e\u5bfc\u51fa\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u628a\u6570\u636e\u5e93\u6570\u636e\u5bfc\u51fa\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u901a\u8fc7 MySQL \u5bfc\u51fa\u6570\u636e\u5e93\u6570\u636e<\/strong><\/p>\n<p><strong>\u5bfc\u51fa\u6570\u636e\u7684\u65b9\u6cd5<\/strong><\/p>\n<p>\u8981\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u4e4b\u4e00\uff1a<\/p>\n<ul>\n<li><strong>dump \u547d\u4ee4\u884c\u5de5\u5177<\/strong><\/li>\n<li><strong>MySQL Workbench \u56fe\u5f62\u754c\u9762<\/strong><\/li>\n<li><strong>\u7b2c\u4e09\u65b9\u5de5\u5177<\/strong><\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528 mysqldump \u547d\u4ee4\u884c\u5de5\u5177\u5bfc\u51fa\u6570\u636e<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u7a97\u53e3\u3002<\/li>\n<li>\u8f6c\u5230\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u76ee\u5f55\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ol>\n<pre>cd \/path\/to\/database_directory<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ol>\n<pre>mysqldump -u username -p database_name &gt; backup.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u66ff\u6362 username \u4e3a\u62e5\u6709\u5bfc\u51fa\u6743\u9650\u7684 MySQL \u7528\u6237\u540d\u3002<\/li>\n<li>\u66ff\u6362 password \u4e3a\u8be5\u7528\u6237\u7684\u5bc6\u7801\u3002<\/li>\n<li>\u66ff\u6362 database_name \u4e3a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002<\/li>\n<li>\u66ff\u6362 backup.sql \u4e3a\u5bfc\u51fa\u7684\u6587\u4ef6\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528 MySQL Workbench \u56fe\u5f62\u754c\u9762\u5bfc\u51fa\u6570\u636e<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 MySQL Workbench\u3002<\/li>\n<li>\u8fde\u63a5\u5230\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\u540d\u79f0\uff0c\u7136\u540e\u9009\u62e9 &#8220;Export Data to File&#8230;&#8221;\u3002<\/li>\n<li>\u5728 &#8220;Select Export Method&#8221; \u5bf9\u8bdd\u6846\u4e2d\uff0c\u9009\u62e9 &#8220;Custom &#8211; Specify record filters or query&#8221;\u3002<\/li>\n<li>\u5728 &#8220;SQL Query&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u8f93\u5165\u8981\u5bfc\u51fa\u7684\u6570\u636e\u67e5\u8be2\u3002<\/li>\n<li>\u5728 &#8220;File Format&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9\u5bfc\u51fa\u7684\u6587\u4ef6\u683c\u5f0f\uff08\u4f8b\u5982\uff0cSQL\u3001CSV \u6216 JSON\uff09\u3002<\/li>\n<li>\u5355\u51fb &#8220;Start Export&#8221; \u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><strong>\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\u5bfc\u51fa\u6570\u636e<\/strong><\/p>\n<p>\u6709\u8bb8\u591a\u7b2c\u4e09\u65b9\u5de5\u5177\u53ef\u4ee5\u7528\u4e8e\u5bfc\u51fa MySQL \u6570\u636e\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li><strong>PhpMyAdmin<\/strong><\/li>\n<li><strong>Navicat<\/strong><\/li>\n<li><strong>SQLyog<\/strong><\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u5de5\u5177\u901a\u5e38\u63d0\u4f9b\u56fe\u5f62\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5bfc\u51fa\u6570\u636e\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u3002<\/p>\n<p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u62e5\u6709\u5bfc\u51fa\u7684\u6743\u9650\u3002<\/li>\n<li>\u5728\u5bfc\u51fa\u6570\u636e\u4e4b\u524d\u521b\u5efa\u6570\u636e\u5e93\u5907\u4efd\u662f\u4e00\u4e2a\u597d\u4e60\u60ef\u3002<\/li>\n<li>\u5bfc\u51fa\u6587\u4ef6\u5e94\u5b58\u50a8\u5728\u5b89\u5168\u7684\u4f4d\u7f6e\u3002<\/li>\n<li>\u5b9a\u671f\u5bfc\u51fa\u6570\u636e\u4ee5\u786e\u4fdd\u6570\u636e\u5b89\u5168\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u628a\u6570\u636e\u5e93\u6570\u636e\u5bfc\u51fa\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u5bfc\u51fa mysql \u6570\u636e\u5e93\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\u884c\u5de5\u5177\u5bfc\u51fa\u6570\u636e\u4f7f\u7528 mysql workbench \u56fe\u5f62\u754c\u9762\u5bfc\u51fa\u6570\u636e\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\u5bfc\u51fa\u6570\u636e\uff0c\u4f8b\u5982 phpmyadmin\u3001navicat \u6216 sqlyog \u5982\u4f55\u901a\u8fc7 MySQL \u5bfc\u51fa\u6570\u636e\u5e93\u6570\u636e \u5bfc\u51fa\u6570\u636e\u7684\u65b9\u6cd5 \u8981\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u4e4b\u4e00\uff1a dump \u547d\u4ee4\u884c\u5de5\u5177 MySQL Workbench \u56fe\u5f62\u754c\u9762 \u7b2c\u4e09\u65b9\u5de5\u5177 \u4f7f\u7528 mysqldump \u547d\u4ee4\u884c\u5de5\u5177\u5bfc\u51fa\u6570\u636e \u6253\u5f00\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u7a97\u53e3\u3002 \u8f6c\u5230\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u76ee\u5f55\uff0c\u4f8b\u5982\uff1a cd \/path\/to\/database_directory \u767b\u5f55\u540e\u590d\u5236 \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a mysqldump -u username -p database_name &gt; backup.sql \u767b\u5f55\u540e\u590d\u5236 \u66ff\u6362 username \u4e3a\u62e5\u6709\u5bfc\u51fa\u6743\u9650\u7684 MySQL \u7528\u6237\u540d\u3002 \u66ff\u6362 password \u4e3a\u8be5\u7528\u6237\u7684\u5bc6\u7801\u3002 \u66ff\u6362 database_name \u4e3a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002 \u66ff\u6362 backup.sql \u4e3a\u5bfc\u51fa\u7684\u6587\u4ef6\u540d\u79f0\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6563","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6563"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6563\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}