{"id":6566,"date":"2024-11-14T10:57:04","date_gmt":"2024-11-14T02:57:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6566\/"},"modified":"2024-11-14T10:57:04","modified_gmt":"2024-11-14T02:57:04","slug":"%e6%80%8e%e4%b9%88%e5%af%bc%e5%87%bamysql%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6566\/","title":{"rendered":"\u600e\u4e48\u5bfc\u51famysql\u6570\u636e\u5e93\u8868"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5bfc\u51fa mysql \u6570\u636e\u5e93\u8868\uff1f\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff1a\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u5207\u6362\u5230\u6570\u636e\u5e93\uff0c\u5bfc\u51fa\u8868\uff08mysqldump table_name &gt; output_file.sql\uff09\u3002\u4f7f\u7528 mysql workbench gui\uff1a\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u5c55\u5f00\u6570\u636e\u5e93\uff0c\u53f3\u952e\u5355\u51fb\u8868\uff0c\u9009\u62e9\u201cdata export\u201d\u5e76\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u8def\u5f84\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080520315980077.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u5bfc\u51famysql\u6570\u636e\u5e93\u8868\u63d2\u56fe\" alt=\"\u600e\u4e48\u5bfc\u51famysql\u6570\u636e\u5e93\u8868\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868<\/strong><\/p>\n<p><strong>\u7b80\u4ecb<\/strong><br \/>\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868\u662f\u6307\u5c06\u8868\u4e2d\u7684\u6570\u636e\u63d0\u53d6\u5230\u4e00\u4e2a\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5b58\u50a8\u3001\u5907\u4efd\u6216\u4f20\u8f93\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e24\u79cd\u5bfc\u51fa MySQL \u8868\u7684\u5e38\u7528\u65b9\u6cd5\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u548c\u4f7f\u7528 MySQL Workbench GUI\u3002<\/p>\n<p><strong>\u547d\u4ee4\u884c\u65b9\u6cd5<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\n<p>\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff1a<\/p>\n<pre>mysql -u username -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06 username \u66ff\u6362\u4e3a MySQL \u7528\u6237\u540d\u3002<\/li>\n<li>\u8f93\u5165\u5bc6\u7801\u65f6\uff0c\u4e0d\u4f1a\u663e\u793a\u4efb\u4f55\u6587\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5207\u6362\u5230\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>USE database_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06 database_name \u66ff\u6362\u4e3a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5bfc\u51fa\u8868\uff1a<\/p>\n<pre>mysqldump table_name &gt; output_file.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06 table_name \u66ff\u6362\u4e3a\u8981\u5bfc\u51fa\u7684\u8868\u7684\u540d\u79f0\u3002<\/li>\n<li>\u5c06 output_file.sql \u66ff\u6362\u4e3a\u60a8\u5e0c\u671b\u5c06\u5bfc\u51fa\u7ed3\u679c\u4fdd\u5b58\u5230\u7684\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>MySQL Workbench GUI \u65b9\u6cd5<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 MySQL Workbench\u3002<\/li>\n<li>\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u3002<\/li>\n<li>\u5728\u201cSchemas\u201d\u9762\u677f\u4e2d\uff0c\u5c55\u5f00\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u8981\u5bfc\u51fa\u7684\u8868\uff0c\u7136\u540e\u9009\u62e9\u201cData Export\u201d\u3002<\/li>\n<li>\n<p>\u5728\u201cExport to File\u201d\u5bf9\u8bdd\u6846\u4e2d\uff1a<\/p>\n<ul>\n<li>\u5728\u201cFormat\u201d\u4e0b\u62c9\u5217\u8868\u4e2d\uff0c\u9009\u62e9\u8981\u5bfc\u51fa\u7684\u683c\u5f0f\uff08\u4f8b\u5982\uff0cSQL\uff09\u3002<\/li>\n<li>\u5728\u201cFile name\u201d\u5b57\u6bb5\u4e2d\uff0c\u6307\u5b9a\u5bfc\u51fa\u7684\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5355\u51fb\u201cStart Export\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><strong>\u5bfc\u51fa\u9009\u9879<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u9644\u52a0\u9009\u9879\u81ea\u5b9a\u4e49\u5bfc\u51fa\u8fc7\u7a0b\uff1a<\/p>\n<ul>\n<li>&#8211;where \u9009\u9879\uff1a\u4ec5\u5bfc\u51fa\u6ee1\u8db3\u7279\u5b9a\u6761\u4ef6\u7684\u884c\u3002<\/li>\n<li>&#8211;fields-terminated-by \u9009\u9879\uff1a\u6307\u5b9a\u5206\u9694\u5bfc\u51fa\u5b57\u6bb5\u7684\u5b57\u7b26\u3002<\/li>\n<li>&#8211;lines-terminated-by \u9009\u9879\uff1a\u6307\u5b9a\u5206\u9694\u5bfc\u51fa\u884c\u7684\u5b57\u7b26\u3002<\/li>\n<li>&#8211;ignore-table \u9009\u9879\uff1a\u6392\u9664\u7279\u5b9a\u8868\u4e0d\u5bfc\u51fa\u3002<\/li>\n<\/ul>\n<p><strong>\u7ed3\u8bba<\/strong><br \/>\u901a\u8fc7\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u6216 MySQL Workbench GUI\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868\u3002\u4e86\u89e3\u4e0d\u540c\u7684\u5bfc\u51fa\u9009\u9879\u53ef\u8ba9\u60a8\u5b9a\u5236\u5bfc\u51fa\u8fc7\u7a0b\uff0c\u4ee5\u6ee1\u8db3\u60a8\u7684\u7279\u5b9a\u9700\u6c42\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5bfc\u51fa\u6570\u636e\u5e93\u8868\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>\u5982\u4f55\u5bfc\u51fa mysql \u6570\u636e\u5e93\u8868\uff1f\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff1a\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u5207\u6362\u5230\u6570\u636e\u5e93\uff0c\u5bfc\u51fa\u8868\uff08mysqldump table_name &gt; output_file.sql\uff09\u3002\u4f7f\u7528 mysql workbench gui\uff1a\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u5c55\u5f00\u6570\u636e\u5e93\uff0c\u53f3\u952e\u5355\u51fb\u8868\uff0c\u9009\u62e9\u201cdata export\u201d\u5e76\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u8def\u5f84\u3002 \u5982\u4f55\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868 \u7b80\u4ecb\u5bfc\u51fa MySQL \u6570\u636e\u5e93\u8868\u662f\u6307\u5c06\u8868\u4e2d\u7684\u6570\u636e\u63d0\u53d6\u5230\u4e00\u4e2a\u6587\u4ef6\uff0c\u4ee5\u4fbf\u5b58\u50a8\u3001\u5907\u4efd\u6216\u4f20\u8f93\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e24\u79cd\u5bfc\u51fa MySQL \u8868\u7684\u5e38\u7528\u65b9\u6cd5\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u548c\u4f7f\u7528 MySQL Workbench GUI\u3002 \u547d\u4ee4\u884c\u65b9\u6cd5 \u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002 \u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff1a mysql -u username -p \u767b\u5f55\u540e\u590d\u5236 \u5c06 username \u66ff\u6362\u4e3a MySQL \u7528\u6237\u540d\u3002 \u8f93\u5165\u5bc6\u7801\u65f6\uff0c\u4e0d\u4f1a\u663e\u793a\u4efb\u4f55\u6587\u672c\u3002 \u5207\u6362\u5230\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\uff1a USE database_name; \u767b\u5f55\u540e\u590d\u5236 \u5c06 database_name \u66ff\u6362\u4e3a\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002 \u5bfc\u51fa\u8868\uff1a mysqldump table_name &gt; output_file.sql \u767b\u5f55\u540e\u590d\u5236 \u5c06 table_name \u66ff\u6362\u4e3a\u8981\u5bfc\u51fa\u7684\u8868\u7684\u540d\u79f0\u3002 \u5c06 output_file.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-6566","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6566","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=6566"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6566\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}