{"id":6545,"date":"2024-11-14T14:58:01","date_gmt":"2024-11-14T06:58:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6545\/"},"modified":"2024-11-14T14:58:01","modified_gmt":"2024-11-14T06:58:01","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6545\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u7684\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u7b54\u6848\uff1a \u4f7f\u7528 mysqldump \u5b9e\u7528\u7a0b\u5e8f\u6216 phpmyadmin \u5bfc\u51fa mysql \u6570\u636e\u5e93\u3002\u8be6\u7ec6\u63cf\u8ff0\uff1a\u4f7f\u7528 mysqldump \u5b9e\u7528\u7a0b\u5e8f\uff1a\u8f93\u5165\u547d\u4ee4\uff1amysqldump [\u9009\u9879] \u6570\u636e\u5e93\u540d\u79f0 &gt; \u8f93\u51fa\u6587\u4ef6\u9009\u9879\uff1a-u\uff1a\u6307\u5b9a\u7528\u6237\u540d-p\uff1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801-h\uff1a\u6307\u5b9a\u4e3b\u673a\u540d&#8211;all-databases\uff1a\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\u4f7f\u7528 phpmyadmin\uff1a\u767b\u5f55\u5230 phpmyadmin\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u5355\u51fb\u201c\u5bfc\u51fa\u201d\u9009\u9879\u5361\u9009\u62e9\u5bfc\u51fa\u7c7b\u578b\uff08\u4f8b\u5982\uff0csql\uff09\u5355\u51fb\u201c\u8f6c\u50a8\u201d\u6309\u94ae\u5bfc\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520073054681.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u7684\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u7684\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 MySQL \u5bfc\u51fa\u6570\u636e\u5e93<\/strong><\/p>\n<p>MySQL \u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u5bfc\u51fa\u6570\u636e\u5e93\u53ca\u5176\u5185\u5bb9\u3002\u5bfc\u51fa\u6570\u636e\u5e93\u53ef\u4ee5\u7528\u4e8e\u5907\u4efd\u76ee\u7684\u3001\u6570\u636e\u4f20\u8f93\u6216\u8fc1\u79fb\u5230\u5176\u4ed6\u7cfb\u7edf\u3002<\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\uff1a<\/strong><\/p>\n<p><strong>1. \u4f7f\u7528 dump \u5b9e\u7528\u7a0b\u5e8f<\/strong><\/p>\n<p>mysqldump \u662f MySQL \u5ba2\u6237\u7aef\u4e2d\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u5bfc\u51fa\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>\u547d\u4ee4\u8bed\u6cd5\uff1a<\/strong><\/p>\n<pre>mysqldump [\u9009\u9879] \u6570\u636e\u5e93\u540d\u79f0 &gt; \u8f93\u51fa\u6587\u4ef6<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u9009\u9879\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>-u \u7528\u6237\u540d\uff1a<\/strong>\u6307\u5b9a\u8fde\u63a5\u6570\u636e\u5e93\u7684\u7528\u6237\u540d\u3002<\/li>\n<li> <strong>-p\uff1a<\/strong>\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002<\/li>\n<li> <strong>-h \u4e3b\u673a\u540d\uff1a<\/strong>\u6307\u5b9a\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216 IP \u5730\u5740\uff08\u53ef\u9009\uff09\u3002<\/li>\n<li> <strong>&#8211;all-databases\uff1a<\/strong>\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p><strong>\u4f8b\u5982\uff1a<\/strong><\/p>\n<p>\u5c06\u540d\u4e3a &#8220;my_database&#8221; \u7684\u6570\u636e\u5e93\u5bfc\u51fa\u5230\u540d\u4e3a &#8220;my_backup.sql&#8221; \u7684\u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre>mysqldump -u root -p my_database &gt; my_backup.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 PHPMyAdmin<\/strong><\/p>\n<p>PHPMyAdmin \u662f\u4e00\u4e2a\u57fa\u4e8e Web \u7684 MySQL \u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u5bfc\u51fa\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li>\u767b\u5f55\u5230 PHPMyAdmin\u3002<\/li>\n<li>\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u5355\u51fb\u201c\u5bfc\u51fa\u201d\u9009\u9879\u5361\u3002<\/li>\n<li>\u9009\u62e9\u5bfc\u51fa\u7c7b\u578b\uff08\u4f8b\u5982\uff0cSQL\uff09\u3002<\/li>\n<li>\u5355\u51fb\u201c\u8f6c\u50a8\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><strong>\u5bfc\u51fa\u6587\u4ef6\u5185\u5bb9\uff1a<\/strong><\/p>\n<p>\u5bfc\u51fa\u7684\u6587\u4ef6\u5305\u542b SQL \u8bed\u53e5\uff0c\u7528\u4e8e\u91cd\u65b0\u521b\u5efa\u6570\u636e\u5e93\u53ca\u5176\u6240\u6709\u5185\u5bb9\uff0c\u5305\u62ec\u8868\u3001\u6570\u636e\u3001\u89c6\u56fe\u548c\u5b58\u50a8\u8fc7\u7a0b\u3002<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u60a8\u5177\u6709\u5bfc\u51fa\u6570\u636e\u5e93\u7684\u6743\u9650\u3002<\/li>\n<li>\u5982\u679c\u6570\u636e\u5e93\u5f88\u5927\uff0c\u5bfc\u51fa\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u6bb5\u65f6\u95f4\u3002<\/li>\n<li>\u5c06\u5bfc\u51fa\u7684\u6587\u4ef6\u5b58\u50a8\u5728\u5b89\u5168\u7684\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u6570\u636e\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>\u7b54\u6848\uff1a \u4f7f\u7528 mysqldump \u5b9e\u7528\u7a0b\u5e8f\u6216 phpmyadmin \u5bfc\u51fa mysql \u6570\u636e\u5e93\u3002\u8be6\u7ec6\u63cf\u8ff0\uff1a\u4f7f\u7528 mysqldump \u5b9e\u7528\u7a0b\u5e8f\uff1a\u8f93\u5165\u547d\u4ee4\uff1amysqldump [\u9009\u9879] \u6570\u636e\u5e93\u540d\u79f0 &gt; \u8f93\u51fa\u6587\u4ef6\u9009\u9879\uff1a-u\uff1a\u6307\u5b9a\u7528\u6237\u540d-p\uff1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801-h\uff1a\u6307\u5b9a\u4e3b\u673a\u540d&#8211;all-databases\uff1a\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\u4f7f\u7528 phpmyadmin\uff1a\u767b\u5f55\u5230 phpmyadmin\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u5355\u51fb\u201c\u5bfc\u51fa\u201d\u9009\u9879\u5361\u9009\u62e9\u5bfc\u51fa\u7c7b\u578b\uff08\u4f8b\u5982\uff0csql\uff09\u5355\u51fb\u201c\u8f6c\u50a8\u201d\u6309\u94ae\u5bfc \u5982\u4f55\u4f7f\u7528 MySQL \u5bfc\u51fa\u6570\u636e\u5e93 MySQL \u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u5bfc\u51fa\u6570\u636e\u5e93\u53ca\u5176\u5185\u5bb9\u3002\u5bfc\u51fa\u6570\u636e\u5e93\u53ef\u4ee5\u7528\u4e8e\u5907\u4efd\u76ee\u7684\u3001\u6570\u636e\u4f20\u8f93\u6216\u8fc1\u79fb\u5230\u5176\u4ed6\u7cfb\u7edf\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\uff1a 1. \u4f7f\u7528 dump \u5b9e\u7528\u7a0b\u5e8f mysqldump \u662f MySQL \u5ba2\u6237\u7aef\u4e2d\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u5bfc\u51fa\u6570\u636e\u5e93\u3002 \u547d\u4ee4\u8bed\u6cd5\uff1a mysqldump [\u9009\u9879] \u6570\u636e\u5e93\u540d\u79f0 &gt; \u8f93\u51fa\u6587\u4ef6 \u767b\u5f55\u540e\u590d\u5236 \u9009\u9879\uff1a -u \u7528\u6237\u540d\uff1a\u6307\u5b9a\u8fde\u63a5\u6570\u636e\u5e93\u7684\u7528\u6237\u540d\u3002 -p\uff1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002 -h \u4e3b\u673a\u540d\uff1a\u6307\u5b9a\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216 IP \u5730\u5740\uff08\u53ef\u9009\uff09\u3002 &#8211;all-databases\uff1a\u5bfc\u51fa\u6240\u6709\u6570\u636e\u5e93\u3002 \u4f8b\u5982\uff1a \u5c06\u540d\u4e3a &#8220;my_database&#8221; \u7684\u6570\u636e\u5e93\u5bfc\u51fa\u5230\u540d\u4e3a &#8220;my_backup.sql&#8221; \u7684\u6587\u4ef6\u4e2d\uff1a mysqldump [&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-6545","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6545","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=6545"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6545\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}