{"id":6557,"date":"2024-11-14T15:08:25","date_gmt":"2024-11-14T07:08:25","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6557\/"},"modified":"2024-11-14T15:08:25","modified_gmt":"2024-11-14T07:08:25","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6557\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u8868\u600e\u4e48\u5bfc\u51fa"},"content":{"rendered":"<blockquote><p>\n  mysql \u6570\u636e\u5e93\u8868\u5bfc\u51fa\u65b9\u6cd5\uff1a\u5bfc\u51fa\u8868\u7ed3\u6784\u548c\u6570\u636e\uff1amysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d &gt; \u5bfc\u51fa\u6587\u4ef6\u540d.sql\u4ec5\u5bfc\u51fa\u8868\u7ed3\u6784\uff1amysqldump &#8211;no-data -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d &gt; \u5bfc\u51fa\u6587\u4ef6\u540d.sql\u4ec5\u5bfc\u51fa\u8868\u6570\u636e\uff1amysqldump &#8211;no-create-info -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d &gt; \u5bfc\u51fa\u6587\u4ef6\u540d.sql\u5bfc\u51fa\u591a\u4e2a\u8868\u5230\u540c\u4e00\u6587\u4ef6\uff1amysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d1 \u8868\u540d2 &#8230;\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520214919874.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u8868\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u8868\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u6570\u636e\u5e93\u8868\u5bfc\u51fa\u65b9\u6cd5<\/strong><\/p>\n<p><strong>\u5bfc\u51fa\u8868\u7ed3\u6784\u548c\u6570\u636e<\/strong><\/p>\n<pre>mysqldump -u &lt;\u7528\u6237\u540d&gt; -p &lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4ec5\u5bfc\u51fa\u8868\u7ed3\u6784<\/strong><\/p>\n<pre>mysqldump --no-data -u &lt;\u7528\u6237\u540d&gt; -p &lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4ec5\u5bfc\u51fa\u8868\u6570\u636e<\/strong><\/p>\n<pre>mysqldump --no-create-info -u &lt;\u7528\u6237\u540d&gt; -p &lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5bfc\u51fa\u591a\u4e2a\u8868\u5230\u540c\u4e00\u6587\u4ef6<\/strong><\/p>\n<pre>mysqldump -u &lt;\u7528\u6237\u540d&gt; -p &lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d1&gt; &lt;\u8868\u540d2&gt; ... &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4f7f\u7528 dump \u9009\u9879<\/strong><\/p>\n<ul>\n<li> <strong>&#8211;lock-tables<\/strong>: \u5728\u5bfc\u51fa\u671f\u95f4\u9501\u5b9a\u8868\uff0c\u4ee5\u9632\u6b62\u6570\u636e\u66f4\u6539\u3002<\/li>\n<li> <strong>&#8211;column-statistics=0<\/strong>: \u7981\u7528\u5217\u7edf\u8ba1\u4fe1\u606f\u7684\u5bfc\u51fa\u3002<\/li>\n<li> <strong>&#8211;single-transaction<\/strong>: \u4ee5\u5355\u4e00\u4e8b\u52a1\u65b9\u5f0f\u5bfc\u51fa\uff0c\u63d0\u9ad8\u4e00\u81f4\u6027\u3002<\/li>\n<li> <strong>&#8211;flush-logs<\/strong>: \u5728\u5bfc\u51fa\u524d\u5237\u65b0\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u786e\u4fdd\u5bfc\u51fa\u662f\u5b8c\u6574\u7684\u3002<\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\u5bfc\u51fa<\/strong><\/p>\n<ul>\n<li> <strong>\u76f4\u63a5\u67e5\u8be2\u8868<\/strong>: \u4f7f\u7528 SELECT \u67e5\u8be2\u8bed\u53e5\u5bfc\u51fa\u8868\u6570\u636e\u3002<\/li>\n<li> <strong>\u7b2c\u4e09\u65b9\u5de5\u5177<\/strong>: \u4f7f\u7528 Navicat\u3001DBeaver \u7b49\u7b2c\u4e09\u65b9\u5de5\u5177\u5bfc\u51fa\u8868\u3002<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u62e5\u6709\u8db3\u591f\u7684\u6570\u636e\u5e93\u6743\u9650\u3002<\/li>\n<li>\u5bfc\u51fa\u6587\u4ef6\u540d\u5e94\u4ee5 .sql \u7ed3\u5c3e\u3002<\/li>\n<li>\u5bfc\u51fa\u6587\u4ef6\u5b58\u50a8\u5728\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e2d\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u8868\u600e\u4e48\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>mysql \u6570\u636e\u5e93\u8868\u5bfc\u51fa\u65b9\u6cd5\uff1a\u5bfc\u51fa\u8868\u7ed3\u6784\u548c\u6570\u636e\uff1amysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d &gt; \u5bfc\u51fa\u6587\u4ef6\u540d.sql\u4ec5\u5bfc\u51fa\u8868\u7ed3\u6784\uff1amysqldump &#8211;no-data -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d &gt; \u5bfc\u51fa\u6587\u4ef6\u540d.sql\u4ec5\u5bfc\u51fa\u8868\u6570\u636e\uff1amysqldump &#8211;no-create-info -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d &gt; \u5bfc\u51fa\u6587\u4ef6\u540d.sql\u5bfc\u51fa\u591a\u4e2a\u8868\u5230\u540c\u4e00\u6587\u4ef6\uff1amysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d \u8868\u540d1 \u8868\u540d2 &#8230; MySQL \u6570\u636e\u5e93\u8868\u5bfc\u51fa\u65b9\u6cd5 \u5bfc\u51fa\u8868\u7ed3\u6784\u548c\u6570\u636e mysqldump -u &lt;\u7528\u6237\u540d&gt; -p &lt;\u5bc6\u7801&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; &lt;\u5bfc\u51fa\u6587\u4ef6\u540d&gt;.sql \u767b\u5f55\u540e\u590d\u5236 \u4ec5\u5bfc\u51fa\u8868\u7ed3\u6784 mysqldump &#8211;no-data -u &lt;\u7528\u6237\u540d&gt; -p [&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-6557","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6557","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=6557"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6557\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}