{"id":6443,"date":"2024-11-14T13:31:27","date_gmt":"2024-11-14T05:31:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6443\/"},"modified":"2024-11-14T13:31:27","modified_gmt":"2024-11-14T05:31:27","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6443\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5bfc\u51fa mysql \u6570\u636e\u5e93\uff1f\u6253\u5f00 mysql \u547d\u4ee4\u884c\u5e76\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\uff0c\u6307\u5b9a\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u6570\u636e\u5e93\u540d\u548c\u5bfc\u51fa\u6587\u4ef6\u540d\u3002\u9a8c\u8bc1\u5bfc\u51fa\u4ee5\u786e\u4fdd\u6b63\u786e\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080507250922671.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p>\u5bfc\u51fa\u4f1a\u5c06 MySQL \u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u4fdd\u5b58\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4ee5\u4fbf\u4ee5\u540e\u5bfc\u5165\u6216\u5907\u4efd\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u7684\u6b65\u9aa4\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u6253\u5f00 MySQL \u547d\u4ee4\u884c<\/strong><\/p>\n<p>\u6253\u5f00 MySQL \u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u7a97\u53e3\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u767b\u5f55 MySQL \u670d\u52a1\u5668\uff1a<\/p>\n<pre>mysql -u &lt;\u7528\u6237\u540d&gt; -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>USE &lt;\u6570\u636e\u5e93\u540d&gt;;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u5bfc\u51fa\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528 dump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\uff1a<\/p>\n<pre>mysqldump --user=&lt;\u7528\u6237\u540d&gt; --password=&lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u53c2\u6570\u8bf4\u660e\uff1a<\/strong><\/p>\n<ul>\n<li>&#8211;user=\uff1a\u6307\u5b9a\u8981\u7528\u4e8e\u5bfc\u51fa\u7684 MySQL \u7528\u6237\u540d\u3002<\/li>\n<li>&#8211;password=\uff1a\u6307\u5b9a MySQL \u7528\u6237\u7684\u5bc6\u7801\u3002<\/li>\n<li>\uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002<\/li>\n<li>.sql\uff1a\u5bfc\u51fa\u7684\u6587\u4ef6\u540d\u548c\u6269\u5c55\u540d\uff08\u901a\u5e38\u4e3a .sql\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 4\uff1a\u9a8c\u8bc1\u5bfc\u51fa<\/strong><\/p>\n<p>\u5bfc\u51fa\u5b8c\u6210\u540e\uff0c\u68c0\u67e5\u5bfc\u51fa\u6587\u4ef6\u4ee5\u786e\u4fdd\u6b63\u786e\uff1a<\/p>\n<pre>cat &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u663e\u793a\u5bfc\u51fa\u6587\u4ef6\u4e2d\u5b58\u50a8\u7684\u6570\u636e\u3002<\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u53ef\u4ee5\u4f7f\u7528 -a \u6216 &#8211;all-databases \u9009\u9879\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\u3002<\/li>\n<li>\u5982\u679c\u8981\u5bfc\u51fa\u7279\u5b9a\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 -t \u9009\u9879\u3002<\/li>\n<li>&#8211;compress \u9009\u9879\u7528\u4e8e\u538b\u7f29\u8f93\u51fa\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\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>\u5982\u4f55\u5bfc\u51fa mysql \u6570\u636e\u5e93\uff1f\u6253\u5f00 mysql \u547d\u4ee4\u884c\u5e76\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\uff0c\u6307\u5b9a\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u6570\u636e\u5e93\u540d\u548c\u5bfc\u51fa\u6587\u4ef6\u540d\u3002\u9a8c\u8bc1\u5bfc\u51fa\u4ee5\u786e\u4fdd\u6b63\u786e\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93 \u5bfc\u51fa\u4f1a\u5c06 MySQL \u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u4fdd\u5b58\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4ee5\u4fbf\u4ee5\u540e\u5bfc\u5165\u6216\u5907\u4efd\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u7684\u6b65\u9aa4\uff1a \u6b65\u9aa4 1\uff1a\u6253\u5f00 MySQL \u547d\u4ee4\u884c \u6253\u5f00 MySQL \u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u7a97\u53e3\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u767b\u5f55 MySQL \u670d\u52a1\u5668\uff1a mysql -u &lt;\u7528\u6237\u540d&gt; -p \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 2\uff1a\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff1a USE &lt;\u6570\u636e\u5e93\u540d&gt;; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 3\uff1a\u5bfc\u51fa\u6570\u636e\u5e93 \u4f7f\u7528 dump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\uff1a mysqldump &#8211;user=&lt;\u7528\u6237\u540d&gt; &#8211;password=&lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql \u767b\u5f55\u540e\u590d\u5236 \u53c2\u6570\u8bf4\u660e\uff1a &#8211;user=\uff1a\u6307\u5b9a\u8981\u7528\u4e8e\u5bfc\u51fa\u7684 MySQL \u7528\u6237\u540d\u3002 &#8211;password=\uff1a\u6307\u5b9a MySQL \u7528\u6237\u7684\u5bc6\u7801\u3002 \uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\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-6443","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6443","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=6443"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6443\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}