{"id":6556,"date":"2024-11-14T11:23:12","date_gmt":"2024-11-14T03:23:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6556\/"},"modified":"2024-11-14T11:23:12","modified_gmt":"2024-11-14T03:23:12","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba%e6%9f%90%e4%ba%9b%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6556\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fa\u67d0\u4e9b\u6570\u636e\u5e93\u7684\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u4ece mysql \u5bfc\u51fa\u7279\u5b9a\u6570\u636e\u5e93\u7684\u6b65\u9aa4\uff1a\u767b\u5f55 mysql \u670d\u52a1\u5668\u3002\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002\u4f7f\u7528 mysqldump \u751f\u6210\u5bfc\u51fa sql \u8bed\u53e5\u3002\u6267\u884c\u5bfc\u51fa\u547d\u4ee4\u3002\u5bfc\u51fa\u5b8c\u6210\u540e\uff0c\u5c06\u751f\u6210\u4e00\u4e2a\u5305\u542b\u6240\u6709 sql \u8bed\u53e5\u7684\u6587\u4ef6\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520194535801.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fa\u67d0\u4e9b\u6570\u636e\u5e93\u7684\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fa\u67d0\u4e9b\u6570\u636e\u5e93\u7684\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u4e2d\u7279\u5b9a\u6570\u636e\u5e93<\/strong><\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<p><strong>1. \u767b\u5f55 MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<p> -u root -p<\/p>\n<p><strong>2. \u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93<\/strong><\/p>\n<p>USE database_name;<\/p>\n<p><strong>3. \u751f\u6210\u5bfc\u51fa SQL \u8bed\u53e5<\/strong><\/p>\n<p>mysqldump -u root -p database_name &gt; dump.sql<\/p>\n<p><strong>4. \u6267\u884c\u5bfc\u51fa<\/strong><\/p>\n<p>\u6309\u56de\u8f66\u952e\u6267\u884c\u5bfc\u51fa\u547d\u4ee4\u3002\u5bfc\u51fa\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u6570\u636e\u5e93\u7684\u5927\u5c0f\u3002<\/p>\n<p><strong>5. \u5bfc\u51fa\u5b8c\u6210<\/strong><\/p>\n<p>\u5bfc\u51fa\u5b8c\u6210\u65f6\uff0c\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3a dump.sql \u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u6240\u9009\u6570\u636e\u5e93\u7684 SQL \u8bed\u53e5\u3002<\/p>\n<p><strong>6. \u6062\u590d\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u8981\u4ece\u5bfc\u51fa\u6587\u4ef6\u4e2d\u6062\u590d\u6570\u636e\u5e93\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>mysql -u root -p database_name <\/p>\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n<ul>\n<li>database_name \u662f\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002<\/li>\n<li>\u53ef\u4ee5\u4f7f\u7528 -h \u53c2\u6570\u6307\u5b9a MySQL \u4e3b\u673a\u3002<\/li>\n<li>\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u9009\u9879\u6765\u5b9a\u5236\u5bfc\u51fa\u8fc7\u7a0b\uff0c\u4f8b\u5982\u6392\u9664\u67d0\u4e9b\u8868\u6216\u6307\u5b9a\u8f93\u51fa\u683c\u5f0f\u3002\u6709\u5173\u66f4\u591a\u9009\u9879\uff0c\u8bf7\u53c2\u9605 mysqldump \u624b\u518c\u9875\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u67d0\u4e9b\u6570\u636e\u5e93\u7684\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>\u4ece mysql \u5bfc\u51fa\u7279\u5b9a\u6570\u636e\u5e93\u7684\u6b65\u9aa4\uff1a\u767b\u5f55 mysql \u670d\u52a1\u5668\u3002\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002\u4f7f\u7528 mysqldump \u751f\u6210\u5bfc\u51fa sql \u8bed\u53e5\u3002\u6267\u884c\u5bfc\u51fa\u547d\u4ee4\u3002\u5bfc\u51fa\u5b8c\u6210\u540e\uff0c\u5c06\u751f\u6210\u4e00\u4e2a\u5305\u542b\u6240\u6709 sql \u8bed\u53e5\u7684\u6587\u4ef6\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u4e2d\u7279\u5b9a\u6570\u636e\u5e93 \u6b65\u9aa4\uff1a 1. \u767b\u5f55 MySQL \u670d\u52a1\u5668 -u root -p 2. \u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93 USE database_name; 3. \u751f\u6210\u5bfc\u51fa SQL \u8bed\u53e5 mysqldump -u root -p database_name &gt; dump.sql 4. \u6267\u884c\u5bfc\u51fa \u6309\u56de\u8f66\u952e\u6267\u884c\u5bfc\u51fa\u547d\u4ee4\u3002\u5bfc\u51fa\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u6570\u636e\u5e93\u7684\u5927\u5c0f\u3002 5. \u5bfc\u51fa\u5b8c\u6210 \u5bfc\u51fa\u5b8c\u6210\u65f6\uff0c\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3a dump.sql \u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u6240\u9009\u6570\u636e\u5e93\u7684 SQL \u8bed\u53e5\u3002 6. \u6062\u590d\u6570\u636e\u5e93 \u8981\u4ece\u5bfc\u51fa\u6587\u4ef6\u4e2d\u6062\u590d\u6570\u636e\u5e93\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a mysql -u root -p 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-6556","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6556","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=6556"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6556\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}