{"id":6554,"date":"2024-11-14T11:16:40","date_gmt":"2024-11-14T03:16:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6554\/"},"modified":"2024-11-14T11:16:40","modified_gmt":"2024-11-14T03:16:40","slug":"mysql%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%basql%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6554\/","title":{"rendered":"mysql\u600e\u4e48\u5bfc\u51fasql\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  mysql \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a sql \u6587\u4ef6\u65b9\u6cd5\u6709\u4e09\u79cd\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\uff1b\u901a\u8fc7 mysql workbench \u56fe\u5f62\u754c\u9762\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\uff1b\u4f7f\u7528 phpmyadmin \u7f51\u7edc\u5de5\u5177\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520185255180.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5bfc\u51fasql\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5bfc\u51fasql\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u4e3a SQL \u6587\u4ef6<\/strong><\/p>\n<p><strong>\u65b9\u6cd5\uff1a<\/strong><\/p>\n<p><strong>1. \u4f7f\u7528 dump \u547d\u4ee4<\/strong><\/p>\n<p>mysqldump \u662f MySQL \u63d0\u4f9b\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u6587\u4ef6\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>mysqldump -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] [\u6570\u636e\u5e93\u540d] &gt; [\u6587\u4ef6\u540d].sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>mysqldump -u root -p my_database &gt; my_database.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 MySQL Workbench<\/strong><\/p>\n<p>MySQL Workbench \u662f\u4e00\u4e2a\u56fe\u5f62\u5316\u754c\u9762\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u7ba1\u7406 MySQL \u6570\u636e\u5e93\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u5bfc\u51fa\u6570\u636e\u5e93\u4e3a SQL \u6587\u4ef6\u3002\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u6253\u5f00 MySQL Workbench\uff0c\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff0c\u9009\u62e9 <strong>\u5bfc\u51fa &gt; \u8f6c\u50a8\u5230\u6587\u4ef6<\/strong>\u3002<\/li>\n<li>\u9009\u62e9 <strong>SQL<\/strong> \u4f5c\u4e3a\u5bfc\u51fa\u683c\u5f0f\u3002<\/li>\n<li>\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u540d\u3002<\/li>\n<\/ul>\n<p><strong>3. \u4f7f\u7528 phpMyAdmin<\/strong><\/p>\n<p>phpMyAdmin \u662f\u4e00\u4e2a\u57fa\u4e8e Web \u7684 MySQL \u7ba1\u7406\u5de5\u5177\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u5bfc\u51fa\u6570\u636e\u5e93\u4e3a SQL \u6587\u4ef6\u3002\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u767b\u5f55 phpMyAdmin\u3002<\/li>\n<li>\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u5355\u51fb <strong>\u5bfc\u51fa<\/strong> \u9009\u9879\u5361\u3002<\/li>\n<li>\u9009\u62e9 <strong>\u5feb\u901f<\/strong> \u5bfc\u51fa\u65b9\u6cd5\u3002<\/li>\n<li>\u9009\u62e9 <strong>SQL<\/strong> \u683c\u5f0f\u3002<\/li>\n<li>\u5355\u51fb <strong>\u6267\u884c<\/strong> \u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><strong>\u5bfc\u51fa\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u62e5\u6709\u5bfc\u51fa\u6570\u636e\u5e93\u6240\u9700\u7684\u6743\u9650\u3002<\/li>\n<li>\u6307\u5b9a\u4e00\u4e2a\u6709\u5199\u6743\u9650\u7684\u8f93\u51fa\u76ee\u5f55\u3002<\/li>\n<li>\u5bfc\u51fa\u6587\u4ef6\u5c06\u5305\u542b\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\u3002<\/li>\n<li>\u5982\u679c\u9700\u8981\u5bfc\u51fa\u7279\u5b9a\u8868\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u4e2d\u4f7f\u7528 &#8211;tables \u9009\u9879\u6307\u5b9a\u8868\u540d\u3002<\/li>\n<li>\u5982\u679c\u9700\u8981\u5bfc\u51fa\u90e8\u5206\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528 &#8211;where \u9009\u9879\u6307\u5b9a\u8fc7\u6ee4\u6761\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fasql\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>mysql \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a sql \u6587\u4ef6\u65b9\u6cd5\u6709\u4e09\u79cd\uff1a\u4f7f\u7528 mysqldump \u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\uff1b\u901a\u8fc7 mysql workbench \u56fe\u5f62\u754c\u9762\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\uff1b\u4f7f\u7528 phpmyadmin \u7f51\u7edc\u5de5\u5177\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u548c\u6570\u636e\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u4e3a SQL \u6587\u4ef6 \u65b9\u6cd5\uff1a 1. \u4f7f\u7528 dump \u547d\u4ee4 mysqldump \u662f MySQL \u63d0\u4f9b\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u6587\u4ef6\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a mysqldump -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] [\u6570\u636e\u5e93\u540d] &gt; [\u6587\u4ef6\u540d].sql \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a mysqldump -u root -p my_database &gt; my_database.sql \u767b\u5f55\u540e\u590d\u5236 2. \u4f7f\u7528 MySQL Workbench MySQL Workbench \u662f\u4e00\u4e2a\u56fe\u5f62\u5316\u754c\u9762\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u7ba1\u7406 MySQL \u6570\u636e\u5e93\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u5bfc\u51fa\u6570\u636e\u5e93\u4e3a SQL [&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-6554","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6554","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=6554"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6554\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}