{"id":6543,"date":"2024-11-14T12:35:17","date_gmt":"2024-11-14T04:35:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6543\/"},"modified":"2024-11-14T12:35:17","modified_gmt":"2024-11-14T04:35:17","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6543\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u8868"},"content":{"rendered":"<blockquote><p>\n  \u5bfc\u51fa mysql \u6570\u636e\u5e93\u8868\u6b65\u9aa4\u5982\u4e0b\uff1a\u8fde\u63a5\u5230 mysql \u670d\u52a1\u5668\u3002\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u8868\uff0c\u6307\u5b9a\u6570\u636e\u5e93\u540d\u3001\u8868\u540d\u3001\u8f93\u51fa\u6587\u4ef6\u8def\u5f84\u53ca\u53ef\u9009\u9009\u9879\uff08\u5feb\u901f\u5bfc\u51fa\u3001\u6240\u6709\u6570\u636e\u5e93\u3001\u6587\u672c\u6a21\u5f0f\u3001\u6269\u5c55\u63d2\u5165\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520064291963.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u8868\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u8868\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868<\/strong><\/p>\n<p>\u5bfc\u51fa\u6570\u636e\u5e93\u8868\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u4efb\u52a1\uff0c\u53ef\u4ee5\u7528\u4e8e\u5907\u4efd\u6570\u636e\u3001\u8fc1\u79fb\u6570\u636e\u6216\u5171\u4eab\u6570\u636e\u3002\u4e0b\u9762\u4ecb\u7ecd\u5728 MySQL \u4e2d\u5bfc\u51fa\u6570\u636e\u5e93\u8868\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<p>\u4f7f\u7528\u60a8\u9009\u62e9\u7684\u5ba2\u6237\u7aef\u5de5\u5177\uff08\u5982 MySQL Workbench \u6216\u547d\u4ee4\u884c\uff09\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u3002\u60a8\u9700\u8981\u63d0\u4f9b\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u670d\u52a1\u5668\u5730\u5740\u3002<\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528 USE \u8bed\u53e5\u9009\u62e9\u8981\u5305\u542b\u5bfc\u51fa\u7684\u8868\u7684\u6570\u636e\u5e93\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>USE my_database;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u5bfc\u51fa\u8868<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u8bed\u6cd5\u5bfc\u51fa\u8868\uff1a<\/p>\n<pre>mysqldump --user=&lt;\u7528\u6237\u540d&gt; --password=&lt;\u5bc6\u7801&gt; --host=&lt;\u670d\u52a1\u5668\u5730\u5740&gt; --port=&lt;\u7aef\u53e3\u53f7&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; &lt;\u8f93\u51fa\u6587\u4ef6\u8def\u5f84&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u5c06 customers \u8868\u4ece my_database \u6570\u636e\u5e93\u5bfc\u51fa\u5230\u540d\u4e3a customers.sql \u7684\u6587\u4ef6\uff1a<\/p>\n<pre>mysqldump --user=root --password=my_password --host=localhost --port=3306 my_database customers &gt; customers.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u53ef\u9009\u9009\u9879\uff1a<\/strong><\/p>\n<p>\u9664\u4e86\u57fa\u672c\u8bed\u6cd5\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u53ef\u9009\u9009\u9879\u8fdb\u4e00\u6b65\u5b9a\u5236\u5bfc\u51fa\u8fc7\u7a0b\uff1a<\/p>\n<ul>\n<li>&#8211;quick\uff1a\u5feb\u901f\u5bfc\u51fa\uff0c\u4e0d\u5305\u62ec\u8868\u5b9a\u4e49\u548c\u89e6\u53d1\u5668\u3002<\/li>\n<li>&#8211;all-databases\uff1a\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002<\/li>\n<li>&#8211;compact\uff1a\u4ee5\u6587\u672c\u6a21\u5f0f\u5bfc\u51fa\uff0c\u6587\u4ef6\u8f83\u5c0f\u4f46\u53ef\u8bfb\u6027\u8f83\u4f4e\u3002<\/li>\n<li>&#8211;extended-insert\uff1a\u4f7f\u7528 INSERT &#8230; VALUES \u8bed\u53e5\u5bfc\u51fa\uff0c\u800c\u4e0d\u662f INSERT &#8230; SELECT \u8bed\u53e5\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u8868\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>\u5bfc\u51fa mysql \u6570\u636e\u5e93\u8868\u6b65\u9aa4\u5982\u4e0b\uff1a\u8fde\u63a5\u5230 mysql \u670d\u52a1\u5668\u3002\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u8868\uff0c\u6307\u5b9a\u6570\u636e\u5e93\u540d\u3001\u8868\u540d\u3001\u8f93\u51fa\u6587\u4ef6\u8def\u5f84\u53ca\u53ef\u9009\u9009\u9879\uff08\u5feb\u901f\u5bfc\u51fa\u3001\u6240\u6709\u6570\u636e\u5e93\u3001\u6587\u672c\u6a21\u5f0f\u3001\u6269\u5c55\u63d2\u5165\uff09\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868 \u5bfc\u51fa\u6570\u636e\u5e93\u8868\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u4efb\u52a1\uff0c\u53ef\u4ee5\u7528\u4e8e\u5907\u4efd\u6570\u636e\u3001\u8fc1\u79fb\u6570\u636e\u6216\u5171\u4eab\u6570\u636e\u3002\u4e0b\u9762\u4ecb\u7ecd\u5728 MySQL \u4e2d\u5bfc\u51fa\u6570\u636e\u5e93\u8868\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a \u6b65\u9aa4 1\uff1a\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668 \u4f7f\u7528\u60a8\u9009\u62e9\u7684\u5ba2\u6237\u7aef\u5de5\u5177\uff08\u5982 MySQL Workbench \u6216\u547d\u4ee4\u884c\uff09\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u3002\u60a8\u9700\u8981\u63d0\u4f9b\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u670d\u52a1\u5668\u5730\u5740\u3002 \u6b65\u9aa4 2\uff1a\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93 \u4f7f\u7528 USE \u8bed\u53e5\u9009\u62e9\u8981\u5305\u542b\u5bfc\u51fa\u7684\u8868\u7684\u6570\u636e\u5e93\u3002\u4f8b\u5982\uff1a USE my_database; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 3\uff1a\u5bfc\u51fa\u8868 \u4f7f\u7528\u4ee5\u4e0b\u8bed\u6cd5\u5bfc\u51fa\u8868\uff1a mysqldump &#8211;user=&lt;\u7528\u6237\u540d&gt; &#8211;password=&lt;\u5bc6\u7801&gt; &#8211;host=&lt;\u670d\u52a1\u5668\u5730\u5740&gt; &#8211;port=&lt;\u7aef\u53e3\u53f7&gt; &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; &lt;\u8f93\u51fa\u6587\u4ef6\u8def\u5f84&gt; \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff0c\u8981\u5c06 customers \u8868\u4ece my_database \u6570\u636e\u5e93\u5bfc\u51fa\u5230\u540d\u4e3a customers.sql \u7684\u6587\u4ef6\uff1a mysqldump &#8211;user=root &#8211;password=my_password &#8211;host=localhost [&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-6543","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6543","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=6543"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6543\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}