{"id":6552,"date":"2024-11-14T09:37:02","date_gmt":"2024-11-14T01:37:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6552\/"},"modified":"2024-11-14T09:37:02","modified_gmt":"2024-11-14T01:37:02","slug":"mysql%e6%9c%ac%e5%9c%b0%e6%95%b0%e6%8d%ae%e5%ba%93%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba%e5%af%bc%e5%85%a5%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6552\/","title":{"rendered":"mysql\u672c\u5730\u6570\u636e\u5e93\u600e\u4e48\u5bfc\u51fa\u5bfc\u5165\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5bfc\u51fa\u548c\u5bfc\u5165 mysql \u6570\u636e\u5e93\uff1a\u767b\u5f55 mysql \u6570\u636e\u5e93\u3002\u5bfc\u51fa\u6570\u636e\u5e93\uff1a\u6267\u884c &#8220;mysqldump&#8221; \u67e5\u8be2\uff0c\u5c06\u6570\u636e\u5e93\u5bfc\u51fa\u5230 .sql \u6587\u4ef6\u4e2d\u3002\u767b\u5f55\u53e6\u4e00\u4e2a mysql \u6570\u636e\u5e93\u3002\u521b\u5efa\u540c\u540d\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09\u3002\u5bfc\u5165\u6570\u636e\u5e93\uff1a\u6267\u884c &#8220;mysql&#8221; \u67e5\u8be2\uff0c\u4ece .sql \u6587\u4ef6\u4e2d\u5bfc\u5165\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520162037883.jpg\" class=\"aligncenter\" title=\"mysql\u672c\u5730\u6570\u636e\u5e93\u600e\u4e48\u5bfc\u51fa\u5bfc\u5165\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u672c\u5730\u6570\u636e\u5e93\u600e\u4e48\u5bfc\u51fa\u5bfc\u5165\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u672c\u5730\u6570\u636e\u5e93\u5bfc\u51fa\u548c\u5bfc\u5165<\/strong><\/p>\n<p><strong>\u5bfc\u51fa\u6570\u636e\u5e93<\/strong><\/p>\n<ol>\n<li>\u767b\u5f55 MySQL \u6570\u636e\u5e93\uff1a\u901a\u8fc7\u547d\u4ee4\u884c\u6216 GUI \u5de5\u5177\uff08\u5982 MySQL Workbench\uff09\u8fde\u63a5\u5230\u60a8\u7684 MySQL \u6570\u636e\u5e93\u3002<\/li>\n<li>\u5bfc\u51fa\u6570\u636e\u5e93\uff1a\u6267\u884c\u4ee5\u4e0b\u67e5\u8be2\u5bfc\u51fa\u6570\u636e\u5e93\u3002\u66ff\u6362 &#8220;database_name&#8221; \u4e3a\u60a8\u7684\u6570\u636e\u5e93\u540d\u79f0\uff0c\u5e76\u4f7f\u7528 &#8220;-p&#8221; \u6807\u5fd7\u6307\u5b9a\u5bc6\u7801\uff08\u53ef\u9009\uff09\u3002<\/li>\n<\/ol>\n<pre>mysqldump -u root -p database_name &gt; database_name.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5bfc\u51fa\u6587\u4ef6\uff1a\u8be5\u67e5\u8be2\u5c06\u521b\u5efa\u540d\u4e3a &#8220;database_name.sql&#8221; \u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ol>\n<p><strong>\u5bfc\u5165\u6570\u636e\u5e93<\/strong><\/p>\n<ol>\n<li>\u767b\u5f55 MySQL \u6570\u636e\u5e93\uff1a\u901a\u8fc7\u547d\u4ee4\u884c\u6216 GUI \u5de5\u5177\u8fde\u63a5\u5230\u53e6\u4e00\u4e2a MySQL \u6570\u636e\u5e93\uff0c\u60a8\u9700\u8981\u5c06\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u5bfc\u5165\u5230\u8be5\u6570\u636e\u5e93\u4e2d\u3002<\/li>\n<li>\u521b\u5efa\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09\uff1a\u5982\u679c\u60a8\u8fd8\u6ca1\u6709\u5728\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u540c\u540d\u7684\u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u67e5\u8be2\u521b\u5efa\u5b83\u3002<\/li>\n<\/ol>\n<pre>CREATE DATABASE database_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5bfc\u5165\u6570\u636e\u5e93\uff1a\u6267\u884c\u4ee5\u4e0b\u67e5\u8be2\u5bfc\u5165\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u3002\u66ff\u6362 &#8220;database_name&#8221; \u4e3a\u60a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002<\/li>\n<\/ol>\n<pre>mysql -u root -p database_name &lt; database_name.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5bfc\u5165\u6587\u4ef6\uff1a\u8be5\u67e5\u8be2\u5c06\u4ece &#8220;database_name.sql&#8221; \u6587\u4ef6\u4e2d\u5bfc\u5165\u6570\u636e\u5e93\u3002<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u5730\u6570\u636e\u5e93\u600e\u4e48\u5bfc\u51fa\u5bfc\u5165\u6570\u636e\u5e93\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\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5bfc\u51fa\u548c\u5bfc\u5165 mysql \u6570\u636e\u5e93\uff1a\u767b\u5f55 mysql \u6570\u636e\u5e93\u3002\u5bfc\u51fa\u6570\u636e\u5e93\uff1a\u6267\u884c &#8220;mysqldump&#8221; \u67e5\u8be2\uff0c\u5c06\u6570\u636e\u5e93\u5bfc\u51fa\u5230 .sql \u6587\u4ef6\u4e2d\u3002\u767b\u5f55\u53e6\u4e00\u4e2a mysql \u6570\u636e\u5e93\u3002\u521b\u5efa\u540c\u540d\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09\u3002\u5bfc\u5165\u6570\u636e\u5e93\uff1a\u6267\u884c &#8220;mysql&#8221; \u67e5\u8be2\uff0c\u4ece .sql \u6587\u4ef6\u4e2d\u5bfc\u5165\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u3002 MySQL \u672c\u5730\u6570\u636e\u5e93\u5bfc\u51fa\u548c\u5bfc\u5165 \u5bfc\u51fa\u6570\u636e\u5e93 \u767b\u5f55 MySQL \u6570\u636e\u5e93\uff1a\u901a\u8fc7\u547d\u4ee4\u884c\u6216 GUI \u5de5\u5177\uff08\u5982 MySQL Workbench\uff09\u8fde\u63a5\u5230\u60a8\u7684 MySQL \u6570\u636e\u5e93\u3002 \u5bfc\u51fa\u6570\u636e\u5e93\uff1a\u6267\u884c\u4ee5\u4e0b\u67e5\u8be2\u5bfc\u51fa\u6570\u636e\u5e93\u3002\u66ff\u6362 &#8220;database_name&#8221; \u4e3a\u60a8\u7684\u6570\u636e\u5e93\u540d\u79f0\uff0c\u5e76\u4f7f\u7528 &#8220;-p&#8221; \u6807\u5fd7\u6307\u5b9a\u5bc6\u7801\uff08\u53ef\u9009\uff09\u3002 mysqldump -u root -p database_name &gt; database_name.sql \u767b\u5f55\u540e\u590d\u5236 \u5bfc\u51fa\u6587\u4ef6\uff1a\u8be5\u67e5\u8be2\u5c06\u521b\u5efa\u540d\u4e3a &#8220;database_name.sql&#8221; \u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u3002 \u5bfc\u5165\u6570\u636e\u5e93 \u767b\u5f55 MySQL \u6570\u636e\u5e93\uff1a\u901a\u8fc7\u547d\u4ee4\u884c\u6216 GUI \u5de5\u5177\u8fde\u63a5\u5230\u53e6\u4e00\u4e2a MySQL \u6570\u636e\u5e93\uff0c\u60a8\u9700\u8981\u5c06\u5bfc\u51fa\u540e\u7684\u6570\u636e\u5e93\u5bfc\u5165\u5230\u8be5\u6570\u636e\u5e93\u4e2d\u3002 \u521b\u5efa\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09\uff1a\u5982\u679c\u60a8\u8fd8\u6ca1\u6709\u5728\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u540c\u540d\u7684\u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u67e5\u8be2\u521b\u5efa\u5b83\u3002 CREATE DATABASE database_name; [&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-6552","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6552","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=6552"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6552\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}