{"id":6583,"date":"2024-11-14T08:35:08","date_gmt":"2024-11-14T00:35:08","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6583\/"},"modified":"2024-11-14T08:35:08","modified_gmt":"2024-11-14T00:35:08","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e4%bb%a3%e7%a0%81%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6583\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u4ee3\u7801\u600e\u4e48\u5bfc\u51fa"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4ee5\u901a\u8fc7 mysql \u5ba2\u6237\u7aef\u767b\u5f55\u6570\u636e\u5e93\uff0c\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff0c\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u53ef\u9009\u7684\u6570\u636e\uff0c\u6700\u540e\u4e0b\u8f7d\u5bfc\u51fa\u7684\u6587\u4ef6\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/06\/2024080610550665926.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u4ee3\u7801\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u4ee3\u7801\u600e\u4e48\u5bfc\u51fa\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u6570\u636e\u5e93\u4ee3\u7801\u5bfc\u51fa\u65b9\u6cd5<\/strong><\/p>\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u767b\u5f55 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528 MySQL \u5ba2\u6237\u7aef\uff08\u5982 MySQL Workbench \u6216\u547d\u4ee4\u884c\uff09\u767b\u5f55\u5230\u60a8\u7684\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>\u7b2c\u4e8c\u6b65\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 database_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff08\u8868\u5b9a\u4e49\u548c\u7ea6\u675f\uff09\uff1a<\/p>\n<pre>mysqldump --no-data database_name &gt; schema.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u7b2c\u56db\u6b65\uff08\u53ef\u9009\uff09\uff1a\u5bfc\u51fa\u6570\u636e<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u5bfc\u51fa\u6570\u636e\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysqldump --no-create-info database_name &gt; data.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u7b2c\u4e94\u6b65\uff08\u53ef\u9009\uff09\uff1a\u7ec4\u5408\u7ed3\u6784\u548c\u6570\u636e<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u5e0c\u671b\u5c06\u7ed3\u6784\u548c\u6570\u636e\u5bfc\u51fa\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysqldump database_name &gt; database.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u7b2c\u516d\u6b65\uff1a\u4e0b\u8f7d\u5bfc\u51fa\u7684\u6587\u4ef6<\/strong><\/p>\n<p>\u4e0b\u8f7d\u5bfc\u51fa\u7684\u6587\u4ef6\uff08schema.sql \u6216 data.sql\uff09\u5230\u60a8\u7684\u672c\u5730\u8ba1\u7b97\u673a\u3002<\/p>\n<p><strong>\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 &#8211;no-create-info \u9009\u9879\u907f\u514d\u5bfc\u51fa CREATE DATABASE \u8bed\u53e5\uff0c\u56e0\u4e3a\u5b83\u53ef\u80fd\u4f1a\u5728\u5bfc\u5165\u65f6\u51fa\u73b0\u95ee\u9898\u3002<\/li>\n<li>\u4f7f\u7528 &#8211;no-data \u9009\u9879\u4ec5\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff0c\u4e0d\u5bfc\u51fa\u6570\u636e\u3002<\/li>\n<li>\u8bf7\u786e\u4fdd\u5728\u5bfc\u51fa\u6570\u636e\u4e4b\u524d\u5907\u4efd\u60a8\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u4ee3\u7801\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\u901a\u8fc7 mysql \u5ba2\u6237\u7aef\u767b\u5f55\u6570\u636e\u5e93\uff0c\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff0c\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u53ef\u9009\u7684\u6570\u636e\uff0c\u6700\u540e\u4e0b\u8f7d\u5bfc\u51fa\u7684\u6587\u4ef6\u3002 MySQL \u6570\u636e\u5e93\u4ee3\u7801\u5bfc\u51fa\u65b9\u6cd5 \u7b2c\u4e00\u6b65\uff1a\u767b\u5f55 MySQL \u6570\u636e\u5e93 \u4f7f\u7528 MySQL \u5ba2\u6237\u7aef\uff08\u5982 MySQL Workbench \u6216\u547d\u4ee4\u884c\uff09\u767b\u5f55\u5230\u60a8\u7684\u6570\u636e\u5e93\u3002 \u7b2c\u4e8c\u6b65\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 database_name; \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u4e09\u6b65\uff1a\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\uff08\u8868\u5b9a\u4e49\u548c\u7ea6\u675f\uff09\uff1a mysqldump &#8211;no-data database_name &gt; schema.sql \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u56db\u6b65\uff08\u53ef\u9009\uff09\uff1a\u5bfc\u51fa\u6570\u636e \u5982\u679c\u60a8\u9700\u8981\u5bfc\u51fa\u6570\u636e\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a mysqldump &#8211;no-create-info database_name &gt; data.sql \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u4e94\u6b65\uff08\u53ef\u9009\uff09\uff1a\u7ec4\u5408\u7ed3\u6784\u548c\u6570\u636e \u5982\u679c\u60a8\u5e0c\u671b\u5c06\u7ed3\u6784\u548c\u6570\u636e\u5bfc\u51fa\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a mysqldump database_name &gt; database.sql \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u516d\u6b65\uff1a\u4e0b\u8f7d\u5bfc\u51fa\u7684\u6587\u4ef6 \u4e0b\u8f7d\u5bfc\u51fa\u7684\u6587\u4ef6\uff08schema.sql \u6216 data.sql\uff09\u5230\u60a8\u7684\u672c\u5730\u8ba1\u7b97\u673a\u3002 \u6ce8\u610f\u4e8b\u9879\uff1a \u4f7f\u7528 &#8211;no-create-info \u9009\u9879\u907f\u514d\u5bfc\u51fa CREATE DATABASE \u8bed\u53e5\uff0c\u56e0\u4e3a\u5b83\u53ef\u80fd\u4f1a\u5728\u5bfc\u5165\u65f6\u51fa\u73b0\u95ee\u9898\u3002 \u4f7f\u7528 &#8211;no-data [&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-6583","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6583","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=6583"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6583\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}