{"id":6548,"date":"2024-11-14T08:08:00","date_gmt":"2024-11-14T00:08:00","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6548\/"},"modified":"2024-11-14T08:08:00","modified_gmt":"2024-11-14T00:08:00","slug":"%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%bamysql%e6%95%b0%e6%8d%ae%e5%ba%93%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6548\/","title":{"rendered":"\u600e\u4e48\u5bfc\u51famysql\u6570\u636e\u5e93\u811a\u672c"},"content":{"rendered":"<blockquote><p>\n  \u5bfc\u51fa mysql \u6570\u636e\u5e93\u811a\u672c\u53ef\u4ee5\u5907\u4efd\u548c\u8fd8\u539f\u6570\u636e\u5e93\u5185\u5bb9\u3002\u6b65\u9aa4\u5982\u4e0b\uff1a\u547d\u4ee4\u884c\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\uff08\u793a\u4f8b\uff1amysqldump -u root -pmypassword my_database &gt; my_database_backup.sql\uff09mysql workbench\uff1a\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\uff0c\u9009\u62e9\u201c\u5907\u4efd\u201d &gt; \u201c\u5bfc\u51fa\u5230\u6587\u4ef6\u201d\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520125016174.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u5bfc\u51famysql\u6570\u636e\u5e93\u811a\u672c\u63d2\u56fe\" alt=\"\u600e\u4e48\u5bfc\u51famysql\u6570\u636e\u5e93\u811a\u672c\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u811a\u672c<\/strong><\/p>\n<p>\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u811a\u672c\u662f\u4e00\u79cd\u5907\u4efd\u548c\u8fd8\u539f\u6570\u636e\u5e93\u5185\u5bb9\u7684\u6709\u6548\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u5bfc\u51fa\u811a\u672c\u7684\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u4f7f\u7528\u547d\u4ee4\u884c<\/strong><\/p>\n<p>\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\uff0c\u5bfc\u822a\u5230 MySQL \u7684 bin \u76ee\u5f55\u3002\u5bf9\u4e8e Windows \u7cfb\u7edf\uff0c\u8def\u5f84\u901a\u5e38\u4e3a C:Program FilesMySQLMySQL Server 8.0in\u3002\u5bf9\u4e8e Mac\/Linux \u7cfb\u7edf\uff0c\u8def\u5f84\u901a\u5e38\u4e3a \/usr\/local\/\/bin\u3002<\/p>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysqldump -u [\u7528\u6237\u540d] -p[\u5bc6\u7801] [\u6570\u636e\u5e93\u540d\u79f0] &gt; [\u811a\u672c\u6587\u4ef6\u540d].sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>mysqldump -u root -pmypassword my_database &gt; my_database_backup.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 MySQL Workbench<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u4f7f\u7528 MySQL Workbench\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u8fde\u63a5\u5230\u60a8\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u9009\u62e9\u201c\u5907\u4efd\u201d &gt; \u201c\u5bfc\u51fa\u5230\u6587\u4ef6\u201d\u3002<\/li>\n<li>\u9009\u62e9\u8f93\u51fa\u6587\u4ef6\u5e76\u5355\u51fb\u201c\u786e\u5b9a\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u5bfc\u51fa\u9009\u9879<\/strong><\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u9009\u9879\u81ea\u5b9a\u4e49\u5bfc\u51fa\u8fc7\u7a0b\uff1a<\/p>\n<ul>\n<li> <strong>-R \u6216 &#8211;routines<\/strong>\uff1a\u5bfc\u51fa\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u548c\u89e6\u53d1\u5668\u3002<\/li>\n<li> <strong>-d \u6216 &#8211;databases<\/strong>\uff1a\u5bfc\u51fa\u591a\u4e2a\u6570\u636e\u5e93\u3002<\/li>\n<li> <strong>&#8211;default-character-set<\/strong>\uff1a\u6307\u5b9a\u5bfc\u51fa\u7684\u5b57\u7b26\u96c6\u3002<\/li>\n<li> <strong>&#8211;single-transaction<\/strong>\uff1a\u5c06\u5bfc\u51fa\u5305\u88c5\u5728\u4e00\u4e2a\u4e8b\u52a1\u4e2d\uff0c\u786e\u4fdd\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u66ff\u6362 [\u7528\u6237\u540d]\u3001[\u5bc6\u7801]\u3001[\u6570\u636e\u5e93\u540d\u79f0] \u548c [\u811a\u672c\u6587\u4ef6\u540d] \u4e3a\u60a8\u7684\u5b9e\u9645\u4fe1\u606f\u3002<\/li>\n<li>\u5bfc\u51fa\u7684\u811a\u672c\u5305\u542b\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u6570\u636e\u548c\u7ed3\u6784\u3002<\/li>\n<li>\u5bfc\u51fa\u7684\u811a\u672c\u53ef\u4ee5\u7528\u4e8e\u4f7f\u7528 mysql \u547d\u4ee4\u884c\u5de5\u5177\u6216 MySQL Workbench \u5bfc\u5165\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u811a\u672c\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\u811a\u672c\u53ef\u4ee5\u5907\u4efd\u548c\u8fd8\u539f\u6570\u636e\u5e93\u5185\u5bb9\u3002\u6b65\u9aa4\u5982\u4e0b\uff1a\u547d\u4ee4\u884c\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\uff08\u793a\u4f8b\uff1amysqldump -u root -pmypassword my_database &gt; my_database_backup.sql\uff09mysql workbench\uff1a\u53f3\u952e\u5355\u51fb\u6570\u636e\u5e93\uff0c\u9009\u62e9\u201c\u5907\u4efd\u201d &gt; \u201c\u5bfc\u51fa\u5230\u6587\u4ef6\u201d \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u811a\u672c \u5bfc\u51fa MySQL \u6570\u636e\u5e93\u811a\u672c\u662f\u4e00\u79cd\u5907\u4efd\u548c\u8fd8\u539f\u6570\u636e\u5e93\u5185\u5bb9\u7684\u6709\u6548\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u5bfc\u51fa\u811a\u672c\u7684\u6b65\u9aa4\uff1a 1. \u4f7f\u7528\u547d\u4ee4\u884c \u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\uff0c\u5bfc\u822a\u5230 MySQL \u7684 bin \u76ee\u5f55\u3002\u5bf9\u4e8e Windows \u7cfb\u7edf\uff0c\u8def\u5f84\u901a\u5e38\u4e3a C:Program FilesMySQLMySQL Server 8.0in\u3002\u5bf9\u4e8e Mac\/Linux \u7cfb\u7edf\uff0c\u8def\u5f84\u901a\u5e38\u4e3a \/usr\/local\/\/bin\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a mysqldump -u [\u7528\u6237\u540d] -p[\u5bc6\u7801] [\u6570\u636e\u5e93\u540d\u79f0] &gt; [\u811a\u672c\u6587\u4ef6\u540d].sql \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a mysqldump -u root -pmypassword my_database &gt; my_database_backup.sql \u767b\u5f55\u540e\u590d\u5236 2. [&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-6548","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6548","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=6548"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6548\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}