{"id":6537,"date":"2024-11-14T09:20:03","date_gmt":"2024-11-14T01:20:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6537\/"},"modified":"2024-11-14T09:20:03","modified_gmt":"2024-11-14T01:20:03","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e8%84%9a%e6%9c%ac%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6537\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u811a\u672c\u600e\u4e48\u5bfc\u51fa"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4ee5\u4f7f\u7528 mysqldump \u5b9e\u7528\u7a0b\u5e8f\u5bfc\u51fa mysql \u6570\u636e\u5e93\u811a\u672c\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\uff1amysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d\u79f0 &gt; \u811a\u672c\u540d.sql\u3002\u9ad8\u7ea7\u9009\u9879\u5305\u62ec\uff1a&#8211;all-databases\uff08\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\uff09\u3001&#8211;tables\uff08\u4ec5\u5bfc\u51fa\u6307\u5b9a\u8868\uff09\u3001&#8211;no-data\uff08\u4e0d\u5305\u62ec\u6570\u636e\uff09\u3001&#8211;create-options\uff08\u5bfc\u51fa\u4e0e create table \u8bed\u53e5\u5173\u8054\u7684\u9009\u9879\uff09\u3001&#8211;routines\uff08\u5bfc\u51fa\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u548c\u89e6\u53d1\u5668\u5b9a\u4e49\uff09\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528 mysql workbench \u901a\u8fc7\u53f3\u952e\u5355\u51fb\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520011082186.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u811a\u672c\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u811a\u672c\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u811a\u672c<\/strong><\/p>\n<p><strong>\u5feb\u6377\u7b80\u5355\u7684\u65b9\u6cd5\uff1a\u4f7f\u7528 dump<\/strong><\/p>\n<p>mysqldump \u662f MySQL \u4e2d\u4e00\u4e2a\u5185\u7f6e\u7684\u5b9e\u7528\u7a0b\u5e8f\uff0c\u7528\u4e8e\u5bfc\u51fa\u6570\u636e\u5e93\u3002\u8981\u4f7f\u7528\u5b83\u5bfc\u51fa\u6570\u636e\u5e93\u811a\u672c\uff1a<\/p>\n<pre>mysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d\u79f0 &gt; \u811a\u672c\u540d.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u547d\u4ee4\u884c\u9009\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>-u\uff1a\u8981\u4f7f\u7528\u7684\u7528\u6237\u540d<\/li>\n<li>-p\uff1a\u5bc6\u7801\u63d0\u793a\uff08\u4e0d\u6307\u5b9a\u5219\u4ece\u63a7\u5236\u53f0\u8bfb\u53d6\uff09<\/li>\n<li>\u6570\u636e\u5e93\u540d\u79f0\uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0<\/li>\n<li>\u811a\u672c\u540d.sql\uff1a\u5e0c\u671b\u4fdd\u5b58\u5bfc\u51fa\u811a\u672c\u7684\u6587\u4ef6\u540d<\/li>\n<\/ul>\n<p><strong>\u9ad8\u7ea7\u9009\u9879\uff1a<\/strong><\/p>\n<p>\u8981\u4f7f\u7528\u66f4\u9ad8\u7ea7\u7684\u9009\u9879\uff0c\u8bf7\u5728 mysqldump \u547d\u4ee4\u4e2d\u6307\u5b9a\u9644\u52a0\u53c2\u6570\uff1a<\/p>\n<ul>\n<li> <strong>&#8211;all-databases<\/strong>\uff1a\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93<\/li>\n<li> <strong>&#8211;tables<\/strong>\uff1a\u4ec5\u5bfc\u51fa\u6307\u5b9a\u8868<\/li>\n<li> <strong>&#8211;no-data<\/strong>\uff1a\u4e0d\u5305\u62ec\u6570\u636e<\/li>\n<li> <strong>&#8211;create-options<\/strong>\uff1a\u5bfc\u51fa\u4e0e CREATE TABLE \u8bed\u53e5\u5173\u8054\u7684\u9009\u9879<\/li>\n<li> <strong>&#8211;routines<\/strong>\uff1a\u5bfc\u51fa\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u548c\u89e6\u53d1\u5668\u5b9a\u4e49<\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528 MySQL Workbench<\/strong><\/p>\n<p>\u9664\u4e86 mysqldump\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528 MySQL Workbench \u5bfc\u51fa\u6570\u636e\u5e93\u811a\u672c\uff1a<\/p>\n<ol>\n<li>\u6253\u5f00 MySQL Workbench \u5e76\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u76ee\u6807\u6570\u636e\u5e93\uff0c\u7136\u540e\u9009\u62e9\u201c\u811a\u672c\u201d &gt; \u201c\u5bfc\u51fa\u201d &gt; \u201c\u521b\u5efa\u201d<\/li>\n<li>\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u5bf9\u8c61\uff08\u8868\u3001\u5b58\u50a8\u8fc7\u7a0b\u7b49\uff09\u548c\u5bfc\u51fa\u9009\u9879\u3002<\/li>\n<li>\u6307\u5b9a\u5bfc\u51fa\u811a\u672c\u7684\u6587\u4ef6\u540d\u3002<\/li>\n<\/ol>\n<p><strong>\u5bfc\u51fa\u811a\u672c\u7684\u7528\u9014\uff1a<\/strong><\/p>\n<p>\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u811a\u672c\u53ef\u7528\u4e8e\u4ee5\u4e0b\u76ee\u7684\uff1a<\/p>\n<ul>\n<li>\u5907\u4efd\u548c\u6062\u590d\u6570\u636e\u5e93<\/li>\n<li>\u90e8\u7f72\u6570\u636e\u5e93\u5230\u4e0d\u540c\u73af\u5883<\/li>\n<li>\u5b58\u6863\u6570\u636e\u5e93\u7ed3\u6784\u7528\u4e8e\u6587\u6863\u76ee\u7684<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u811a\u672c\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>\u53ef\u4ee5\u4f7f\u7528 mysqldump \u5b9e\u7528\u7a0b\u5e8f\u5bfc\u51fa mysql \u6570\u636e\u5e93\u811a\u672c\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\uff1amysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d\u79f0 &gt; \u811a\u672c\u540d.sql\u3002\u9ad8\u7ea7\u9009\u9879\u5305\u62ec\uff1a&#8211;all-databases\uff08\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\uff09\u3001&#8211;tables\uff08\u4ec5\u5bfc\u51fa\u6307\u5b9a\u8868\uff09\u3001&#8211;no-data\uff08\u4e0d\u5305\u62ec\u6570\u636e\uff09\u3001&#8211;create-options\uff08\u5bfc\u51fa\u4e0e create table \u8bed\u53e5\u5173\u8054\u7684\u9009\u9879\uff09\u3001&#8211;routines\uff08\u5bfc\u51fa\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u548c\u89e6\u53d1\u5668\u5b9a\u4e49\uff09\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528 mysql workbench \u901a\u8fc7\u53f3\u952e\u5355\u51fb \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u811a\u672c \u5feb\u6377\u7b80\u5355\u7684\u65b9\u6cd5\uff1a\u4f7f\u7528 dump mysqldump \u662f MySQL \u4e2d\u4e00\u4e2a\u5185\u7f6e\u7684\u5b9e\u7528\u7a0b\u5e8f\uff0c\u7528\u4e8e\u5bfc\u51fa\u6570\u636e\u5e93\u3002\u8981\u4f7f\u7528\u5b83\u5bfc\u51fa\u6570\u636e\u5e93\u811a\u672c\uff1a mysqldump -u \u7528\u6237\u540d -p \u5bc6\u7801 \u6570\u636e\u5e93\u540d\u79f0 &gt; \u811a\u672c\u540d.sql \u767b\u5f55\u540e\u590d\u5236 \u547d\u4ee4\u884c\u9009\u9879\uff1a -u\uff1a\u8981\u4f7f\u7528\u7684\u7528\u6237\u540d -p\uff1a\u5bc6\u7801\u63d0\u793a\uff08\u4e0d\u6307\u5b9a\u5219\u4ece\u63a7\u5236\u53f0\u8bfb\u53d6\uff09 \u6570\u636e\u5e93\u540d\u79f0\uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0 \u811a\u672c\u540d.sql\uff1a\u5e0c\u671b\u4fdd\u5b58\u5bfc\u51fa\u811a\u672c\u7684\u6587\u4ef6\u540d \u9ad8\u7ea7\u9009\u9879\uff1a \u8981\u4f7f\u7528\u66f4\u9ad8\u7ea7\u7684\u9009\u9879\uff0c\u8bf7\u5728 mysqldump \u547d\u4ee4\u4e2d\u6307\u5b9a\u9644\u52a0\u53c2\u6570\uff1a &#8211;all-databases\uff1a\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93 &#8211;tables\uff1a\u4ec5\u5bfc\u51fa\u6307\u5b9a\u8868 &#8211;no-data\uff1a\u4e0d\u5305\u62ec\u6570\u636e &#8211;create-options\uff1a\u5bfc\u51fa\u4e0e CREATE TABLE \u8bed\u53e5\u5173\u8054\u7684\u9009\u9879 &#8211;routines\uff1a\u5bfc\u51fa\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u548c\u89e6\u53d1\u5668\u5b9a\u4e49 \u4f7f\u7528 MySQL [&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-6537","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6537","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=6537"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6537\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}