{"id":6539,"date":"2024-11-14T13:37:36","date_gmt":"2024-11-14T05:37:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6539\/"},"modified":"2024-11-14T13:37:36","modified_gmt":"2024-11-14T05:37:36","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae%e5%ba%93%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6539\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863"},"content":{"rendered":"<blockquote><p>\n  \u5bfc\u51fa mysql \u6570\u636e\u5e93\u6587\u6863\u7684\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\u67b6\u6784\u548c\u6570\u636e\uff1amysqldump &#8211;database-schema [\u9009\u9879] \u6570\u636e\u5e93\u540d &gt; \u6587\u6863\u6587\u4ef6.sql\u4f7f\u7528 phpmyadmin \u7684 &#8220;\u5bfc\u51fa&#8221; \u9009\u9879\u5361\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff1a\u9009\u62e9\u6570\u636e\u5e93\uff0c\u70b9\u51fb &#8220;\u5bfc\u51fa&#8221; -&gt; &#8220;\u7ed3\u6784&#8221; -&gt; \u6307\u5b9a\u5bfc\u51fa\u683c\u5f0f -&gt; \u5f00\u59cb\u5bfc\u51fa\u4f7f\u7528 sqlyog \u7684 &#8220;\u5bfc\u51fa&#8221; \u529f\u80fd\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff1a\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\uff0c\u9009\u62e9 &#8220;\u5bfc\u51fa&#8221; -&gt; &#8220;\u6570\u636e\u5e93\u7ed3\u6784&#8221; -&gt; \u6307\u5b9a\u5bfc\u51fa\u683c\u5f0f -&amp;gt\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520014884529.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u6587\u6863<\/strong><\/p>\n<p>MySQL \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4e86\u89e3\u6570\u636e\u5e93\u7ed3\u6784\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u5728 MySQL \u4e2d\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u7684\u6b65\u9aa4\u3002<\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<p><strong>1. \u4f7f\u7528 dump \u547d\u4ee4<\/strong><\/p>\n<p>mysqldump \u547d\u4ee4\u662f\u4e00\u4e2a\u7528\u4e8e\u4ece MySQL \u6570\u636e\u5e93\u5bfc\u51fa\u6570\u636e\u7684\u5b9e\u7528\u7a0b\u5e8f\u3002\u5b83\u8fd8\u80fd\u591f\u751f\u6210\u6570\u636e\u5e93\u7ed3\u6784\u6587\u6863\u3002<\/p>\n<p><strong>\u547d\u4ee4\u8bed\u6cd5\uff1a<\/strong><\/p>\n<pre>mysqldump --database-schema [\u9009\u9879] \u6570\u636e\u5e93\u540d &gt; \u6587\u6863\u6587\u4ef6.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u9009\u9879\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>&#8211;database-schema\uff1a<\/strong>\u4ec5\u5bfc\u51fa\u6570\u636e\u5e93\u67b6\u6784\uff0c\u4e0d\u5bfc\u51fa\u6570\u636e\u3002<\/li>\n<li> <strong>&#8211;no-data\uff1a<\/strong>\u5bfc\u51fa\u8868\u7ed3\u6784\uff0c\u4f46\u8df3\u8fc7\u6570\u636e\u3002<\/li>\n<li> <strong>&#8211;add-drop-table\uff1a<\/strong>\u5728\u8f93\u51fa\u4e2d\u6dfb\u52a0 DROP TABLE \u8bed\u53e5\uff0c\u4ee5\u4fbf\u5728\u91cd\u65b0\u5bfc\u5165\u65f6\u5220\u9664\u73b0\u6709\u7684\u8868\u3002<\/li>\n<li> <strong>&#8211;skip-comments\uff1a<\/strong>\u8df3\u8fc7 SQL \u8bed\u53e5\u4e2d\u7684\u6ce8\u91ca\u3002<\/li>\n<\/ul>\n<p><strong>2. \u4f7f\u7528 phpMyAdmin<\/strong><\/p>\n<p>phpMyAdmin \u662f\u4e00\u4e2a\u57fa\u4e8e Web \u7684 MySQL \u7ba1\u7406\u5de5\u5177\u3002\u5b83\u5177\u6709\u4e00\u4e2a\u5bfc\u51fa\u9009\u9879\uff0c\u53ef\u7528\u4e8e\u751f\u6210\u6570\u636e\u5e93\u6587\u6863\u3002<\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ul>\n<li>\u767b\u5f55 phpMyAdmin\u3002<\/li>\n<li>\u9009\u62e9\u8981\u5bfc\u51fa\u6587\u6863\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u70b9\u51fb &#8220;\u5bfc\u51fa&#8221; \u9009\u9879\u5361\u3002<\/li>\n<li>\u5728 &#8220;\u5bfc\u51fa\u7c7b\u578b&#8221; \u4e0b\u62c9\u83dc\u5355\u4e2d\uff0c\u9009\u62e9 &#8220;\u7ed3\u6784&#8221;\u3002<\/li>\n<li>\u9009\u62e9\u6240\u9700\u7684\u5bfc\u51fa\u683c\u5f0f\uff08SQL\u3001PDF\u3001HTML \u7b49\uff09\u3002<\/li>\n<li>\u70b9\u51fb &#8220;\u7acb\u5373\u5f00\u59cb&#8221; \u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><strong>3. \u4f7f\u7528 SQLyog<\/strong><\/p>\n<p>SQLyog \u662f\u4e00\u4e2a\u5546\u4e1a MySQL \u7ba1\u7406\u5de5\u5177\u3002\u5b83\u63d0\u4f9b\u4e86\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u7684\u4e13\u7528\u529f\u80fd\u3002<\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 SQLyog \u5e76\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\u540d\u79f0\u5e76\u9009\u62e9 &#8220;\u5bfc\u51fa&#8221;\u3002<\/li>\n<li>\u5728 &#8220;\u5bfc\u51fa\u5411\u5bfc&#8221; \u4e2d\uff0c\u9009\u62e9 &#8220;\u6570\u636e\u5e93\u7ed3\u6784&#8221;\u3002<\/li>\n<li>\u9009\u62e9\u6240\u9700\u7684\u5bfc\u51fa\u683c\u5f0f\uff08SQL\u3001HTML \u7b49\uff09\u3002<\/li>\n<li>\u70b9\u51fb &#8220;\u4e0b\u4e00\u6b65&#8221; \u5e76\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\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\u6587\u6863\u7684\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\u67b6\u6784\u548c\u6570\u636e\uff1amysqldump &#8211;database-schema [\u9009\u9879] \u6570\u636e\u5e93\u540d &gt; \u6587\u6863\u6587\u4ef6.sql\u4f7f\u7528 phpmyadmin \u7684 &#8220;\u5bfc\u51fa&#8221; \u9009\u9879\u5361\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff1a\u9009\u62e9\u6570\u636e\u5e93\uff0c\u70b9\u51fb &#8220;\u5bfc\u51fa&#8221; -&gt; &#8220;\u7ed3\u6784&#8221; -&gt; \u6307\u5b9a\u5bfc\u51fa\u683c\u5f0f -&gt; \u5f00\u59cb\u5bfc\u51fa\u4f7f\u7528 sqlyog \u7684 &#8220;\u5bfc\u51fa&#8221; \u529f\u80fd\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff1a\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\uff0c\u9009\u62e9 &#8220;\u5bfc\u51fa&#8221; -&gt; &#8220;\u6570\u636e\u5e93\u7ed3\u6784&#8221; -&gt; \u6307\u5b9a\u5bfc\u51fa\u683c\u5f0f -&amp;gt \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u6587\u6863 MySQL \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4e86\u89e3\u6570\u636e\u5e93\u7ed3\u6784\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u5728 MySQL \u4e2d\u5bfc\u51fa\u6570\u636e\u5e93\u6587\u6863\u7684\u6b65\u9aa4\u3002 \u6b65\u9aa4\uff1a 1. \u4f7f\u7528 dump \u547d\u4ee4 mysqldump \u547d\u4ee4\u662f\u4e00\u4e2a\u7528\u4e8e\u4ece MySQL \u6570\u636e\u5e93\u5bfc\u51fa\u6570\u636e\u7684\u5b9e\u7528\u7a0b\u5e8f\u3002\u5b83\u8fd8\u80fd\u591f\u751f\u6210\u6570\u636e\u5e93\u7ed3\u6784\u6587\u6863\u3002 \u547d\u4ee4\u8bed\u6cd5\uff1a mysqldump &#8211;database-schema [\u9009\u9879] \u6570\u636e\u5e93\u540d &gt; \u6587\u6863\u6587\u4ef6.sql \u767b\u5f55\u540e\u590d\u5236 [&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-6539","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6539","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=6539"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6539\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}