{"id":6536,"date":"2024-11-14T12:54:32","date_gmt":"2024-11-14T04:54:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6536\/"},"modified":"2024-11-14T12:54:32","modified_gmt":"2024-11-14T04:54:32","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%badb%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6536\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fadb\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u5bfc\u51fa mysql \u6570\u636e\u5e93\u7684\u65b9\u6cd5\u6709\u4e09\u79cd\uff1a\u4f7f\u7528 mysqldump \u5de5\u5177\u547d\u4ee4\uff1amysqldump -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] &gt; [\u6587\u4ef6\u540d].sql\uff1b\u4f7f\u7528 phpmyadmin \u7ba1\u7406\u754c\u9762\uff1b\u901a\u8fc7 mysqlexport \u547d\u4ee4\uff1amysqlexport -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] &#8211;export-all &gt; [\u6587\u4ef6\u540d].sql\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080519582681719.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fadb\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fadb\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u4f7f\u7528 dump \u5de5\u5177<\/strong><\/p>\n<p><strong>\u547d\u4ee4\uff1a<\/strong><\/p>\n<pre>mysqldump -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] &gt; [\u6587\u4ef6\u540d].sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u53c2\u6570\u8bf4\u660e\uff1a<\/strong><\/p>\n<ul>\n<li>-u [\u7528\u6237\u540d]\uff1a\u6307\u5b9a\u8981\u8fde\u63a5\u6570\u636e\u5e93\u7684\u7528\u6237\u540d<\/li>\n<li>-p\uff1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801<\/li>\n<li>[\u6570\u636e\u5e93\u540d\u79f0]\uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0<\/li>\n<li>[\u6587\u4ef6\u540d].sql\uff1a\u5bfc\u51fa\u7684 SQL \u6587\u4ef6\u540d\u79f0<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 2\uff1a\u4f7f\u7528 phpMyAdmin \u7ba1\u7406\u754c\u9762<\/strong><\/p>\n<p><strong>\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li>\u767b\u5f55 phpMyAdmin \u5e76\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93<\/li>\n<li>\u5728\u5de6\u4fa7\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u5bfc\u51fa\u201d\u9009\u9879\u5361<\/li>\n<li>\u5728\u201c\u5bfc\u51fa\u201d\u9875\u9762\u4e2d\uff0c\u9009\u62e9\u201c\u5feb\u901f\u201d\u6216\u201c\u81ea\u5b9a\u4e49\u201d\u5bfc\u51fa\u65b9\u6cd5<\/li>\n<li>\u9009\u62e9\u5bfc\u51fa\u7684\u6587\u4ef6\u683c\u5f0f\uff08\u5982 SQL\u3001CSV \u6216\u5176\u4ed6\uff09<\/li>\n<li>\u70b9\u51fb\u201c\u6267\u884c\u201d\u6309\u94ae\u5373\u53ef\u5bfc\u51fa\u6570\u636e\u5e93<\/li>\n<\/ol>\n<p><strong>\u6b65\u9aa4 3\uff1a\u901a\u8fc7 mysqlexport \u547d\u4ee4<\/strong><\/p>\n<p><strong>\u547d\u4ee4\uff1a<\/strong><\/p>\n<pre>mysqlexport -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] --export-all &gt; [\u6587\u4ef6\u540d].sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u53c2\u6570\u8bf4\u660e\uff1a<\/strong><\/p>\n<ul>\n<li>-u [\u7528\u6237\u540d]\uff1a\u6307\u5b9a\u8981\u8fde\u63a5\u6570\u636e\u5e93\u7684\u7528\u6237\u540d<\/li>\n<li>-p\uff1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801<\/li>\n<li>[\u6570\u636e\u5e93\u540d\u79f0]\uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0<\/li>\n<li>&#8211;export-all\uff1a\u5bfc\u51fa\u6574\u4e2a\u6570\u636e\u5e93\u6240\u6709\u8868<\/li>\n<li>[\u6587\u4ef6\u540d].sql\uff1a\u5bfc\u51fa\u7684 SQL \u6587\u4ef6\u540d\u79f0<\/li>\n<\/ul>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728\u6267\u884c\u5bfc\u51fa\u547d\u4ee4\u4e4b\u524d\uff0c\u786e\u4fdd\u5df2\u521b\u5efa\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u7684\u5907\u4efd\u3002<\/li>\n<li>\u5bfc\u51fa\u7684 SQL \u6587\u4ef6\u53ef\u4ee5\u7528\u6765\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u6216\u8bbe\u5907\u4e0a\u91cd\u65b0\u521b\u5efa\u6570\u636e\u5e93\u3002<\/li>\n<li>\u6839\u636e\u6570\u636e\u5e93\u7684\u5927\u5c0f\u548c\u590d\u6742\u6027\uff0c\u5bfc\u51fa\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fadb\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>\u5bfc\u51fa mysql \u6570\u636e\u5e93\u7684\u65b9\u6cd5\u6709\u4e09\u79cd\uff1a\u4f7f\u7528 mysqldump \u5de5\u5177\u547d\u4ee4\uff1amysqldump -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] &gt; [\u6587\u4ef6\u540d].sql\uff1b\u4f7f\u7528 phpmyadmin \u7ba1\u7406\u754c\u9762\uff1b\u901a\u8fc7 mysqlexport \u547d\u4ee4\uff1amysqlexport -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] &#8211;export-all &gt; [\u6587\u4ef6\u540d].sql\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93 \u6b65\u9aa4 1\uff1a\u4f7f\u7528 dump \u5de5\u5177 \u547d\u4ee4\uff1a mysqldump -u [\u7528\u6237\u540d] -p [\u6570\u636e\u5e93\u540d\u79f0] &gt; [\u6587\u4ef6\u540d].sql \u767b\u5f55\u540e\u590d\u5236 \u53c2\u6570\u8bf4\u660e\uff1a -u [\u7528\u6237\u540d]\uff1a\u6307\u5b9a\u8981\u8fde\u63a5\u6570\u636e\u5e93\u7684\u7528\u6237\u540d -p\uff1a\u63d0\u793a\u8f93\u5165\u5bc6\u7801 [\u6570\u636e\u5e93\u540d\u79f0]\uff1a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u540d\u79f0 [\u6587\u4ef6\u540d].sql\uff1a\u5bfc\u51fa\u7684 SQL \u6587\u4ef6\u540d\u79f0 \u6b65\u9aa4 2\uff1a\u4f7f\u7528 phpMyAdmin \u7ba1\u7406\u754c\u9762 \u64cd\u4f5c\u6b65\u9aa4\uff1a \u767b\u5f55 phpMyAdmin \u5e76\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93 \u5728\u5de6\u4fa7\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u5bfc\u51fa\u201d\u9009\u9879\u5361 [&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-6536","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6536","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=6536"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6536\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}