{"id":6468,"date":"2024-11-14T11:52:55","date_gmt":"2024-11-14T03:52:55","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6468\/"},"modified":"2024-11-14T11:52:55","modified_gmt":"2024-11-14T03:52:55","slug":"sql%e6%96%87%e4%bb%b6%e6%80%8e%e4%b9%88%e5%af%bc%e5%85%a5mysql%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6468\/","title":{"rendered":"sql\u6587\u4ef6\u600e\u4e48\u5bfc\u5165mysql\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5c06 sql \u6587\u4ef6\u5bfc\u5165 mysql \u6570\u636e\u5e93\uff1f\u51c6\u5907 sql \u6587\u4ef6\uff1a\u83b7\u53d6\u5e76\u68c0\u67e5 sql \u6587\u4ef6\u7684\u8bed\u6cd5\u3002\u8fde\u63a5\u5230 mysql\uff1a\u4f7f\u7528\u51ed\u636e\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002\u521b\u5efa\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09\uff1a\u5982\u679c\u5bfc\u5165\u7684\u6570\u636e\u9700\u8981\u65b0\u6570\u636e\u5e93\uff0c\u8bf7\u521b\u5efa\u3002\u9009\u62e9\u6570\u636e\u5e93\uff1a\u9009\u62e9\u8981\u5bfc\u5165\u6570\u636e\u7684\u76ee\u6807\u6570\u636e\u5e93\u3002\u5bfc\u5165 sql \u6587\u4ef6\uff1a\u4f7f\u7528 mysql \u547d\u4ee4\uff0c\u66ff\u6362\u76f8\u5e94\u503c\uff0c\u5bfc\u5165\u6587\u4ef6\u3002\u786e\u8ba4\u5bfc\u5165\uff1a\u67e5\u770b\u5bfc\u5165\u662f\u5426\u6210\u529f\uff0c\u5e76\u4f7f\u7528 select \u8bed\u53e5\u9a8c\u8bc1\u6570\u636e\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080508073776245.jpg\" class=\"aligncenter\" title=\"sql\u6587\u4ef6\u600e\u4e48\u5bfc\u5165mysql\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"sql\u6587\u4ef6\u600e\u4e48\u5bfc\u5165mysql\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5c06 SQL \u6587\u4ef6\u5bfc\u5165 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p>\u5c06 SQL \u6587\u4ef6\u5bfc\u5165 MySQL \u6570\u636e\u5e93\u662f\u4e00\u79cd\u5c06\u6570\u636e\u548c\u6a21\u5f0f\u4ece\u6587\u4ef6\u4e2d\u52a0\u8f7d\u5230\u6570\u636e\u5e93\u4e2d\u7684\u5e38\u89c1\u64cd\u4f5c\u3002\u4ee5\u4e0b\u6b65\u9aa4\u8be6\u7ec6\u8bf4\u660e\u4e86\u5982\u4f55\u6267\u884c\u6b64\u8fc7\u7a0b\uff1a<\/p>\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u51c6\u5907 SQL \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u60a8\u62e5\u6709\u8981\u5bfc\u5165\u7684 SQL \u6587\u4ef6\u3002<\/li>\n<li>\u68c0\u67e5\u6587\u4ef6\u5185\u5bb9\u5e76\u786e\u4fdd\u8bed\u6cd5\u6b63\u786e\u65e0\u8bef\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u8fde\u63a5\u5230 MySQL<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5de5\u5177\u6216 GUI \u8fde\u63a5\u5230\u60a8\u7684\u6570\u636e\u5e93\u3002<\/li>\n<li>\u8f93\u5165\u60a8\u7684\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u6570\u636e\u5e93\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u521b\u5efa\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u8981\u5bfc\u5165 SQL \u6587\u4ef6\u5c06\u5bfc\u5165\u7684\u65b0\u6570\u636e\uff0c\u5219\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u636e\u5e93\u3002<\/li>\n<li>\u4f7f\u7528 CREATE DATABASE \u8bed\u53e5\u521b\u5efa\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u56db\u6b65\uff1a\u9009\u62e9\u6570\u636e\u5e93<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 USE \u8bed\u53e5\u9009\u62e9\u60a8\u8981\u5bfc\u5165\u6570\u636e\u7684\u76ee\u6807\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p><strong>\u7b2c\u4e94\u6b65\uff1a\u5bfc\u5165 SQL \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u5165 SQL \u6587\u4ef6\uff1a<\/p>\n<pre>mysql -u &lt;username&gt; -p &lt;password&gt; &lt;database_name&gt; &lt; &lt;file_name&gt;.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\u5c06 \u3001 \u3001 \u548c \u66ff\u6362\u4e3a\u60a8\u81ea\u5df1\u7684\u503c\u3002 <\/li>\n<\/ul>\n<p><strong>\u7b2c\u516d\u6b65\uff1a\u786e\u8ba4\u5bfc\u5165<\/strong><\/p>\n<ul>\n<li>\u5bfc\u5165\u5b8c\u6210\u540e\uff0c\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u4e00\u6761\u6d88\u606f\uff0c\u6307\u793a\u5bfc\u5165\u5df2\u6210\u529f\u5b8c\u6210\u3002<\/li>\n<li>\u60a8\u53ef\u4ee5\u4f7f\u7528 SELECT \u8bed\u53e5\u68c0\u67e5\u6570\u636e\u662f\u5426\u5df2\u6b63\u786e\u5bfc\u5165\u3002<\/li>\n<\/ul>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u60a8\u9047\u5230\u8bed\u6cd5\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5 SQL \u6587\u4ef6\u7684\u683c\u5f0f\u548c\u5185\u5bb9\u3002<\/li>\n<li>\u5982\u679c\u60a8\u9700\u8981\u5bfc\u5165\u5927\u91cf\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528 MySQL \u7684 LOAD DATA INFILE \u8bed\u53e5\u3002<\/li>\n<li>\u4e3a\u4e86\u5b89\u5168\u8d77\u89c1\uff0c\u5728\u5bfc\u5165\u6587\u4ef6\u4e4b\u524d\u7ecf\u5e38\u5907\u4efd\u60a8\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662fsql\u6587\u4ef6\u600e\u4e48\u5bfc\u5165\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>\u5982\u4f55\u5c06 sql \u6587\u4ef6\u5bfc\u5165 mysql \u6570\u636e\u5e93\uff1f\u51c6\u5907 sql \u6587\u4ef6\uff1a\u83b7\u53d6\u5e76\u68c0\u67e5 sql \u6587\u4ef6\u7684\u8bed\u6cd5\u3002\u8fde\u63a5\u5230 mysql\uff1a\u4f7f\u7528\u51ed\u636e\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002\u521b\u5efa\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09\uff1a\u5982\u679c\u5bfc\u5165\u7684\u6570\u636e\u9700\u8981\u65b0\u6570\u636e\u5e93\uff0c\u8bf7\u521b\u5efa\u3002\u9009\u62e9\u6570\u636e\u5e93\uff1a\u9009\u62e9\u8981\u5bfc\u5165\u6570\u636e\u7684\u76ee\u6807\u6570\u636e\u5e93\u3002\u5bfc\u5165 sql \u6587\u4ef6\uff1a\u4f7f\u7528 mysql \u547d\u4ee4\uff0c\u66ff\u6362\u76f8\u5e94\u503c\uff0c\u5bfc\u5165\u6587\u4ef6\u3002\u786e\u8ba4\u5bfc\u5165\uff1a\u67e5\u770b\u5bfc\u5165\u662f\u5426\u6210\u529f\uff0c\u5e76\u4f7f\u7528 select \u8bed\u53e5\u9a8c\u8bc1\u6570\u636e\u3002 \u5982\u4f55\u5c06 SQL \u6587\u4ef6\u5bfc\u5165 MySQL \u6570\u636e\u5e93 \u5c06 SQL \u6587\u4ef6\u5bfc\u5165 MySQL \u6570\u636e\u5e93\u662f\u4e00\u79cd\u5c06\u6570\u636e\u548c\u6a21\u5f0f\u4ece\u6587\u4ef6\u4e2d\u52a0\u8f7d\u5230\u6570\u636e\u5e93\u4e2d\u7684\u5e38\u89c1\u64cd\u4f5c\u3002\u4ee5\u4e0b\u6b65\u9aa4\u8be6\u7ec6\u8bf4\u660e\u4e86\u5982\u4f55\u6267\u884c\u6b64\u8fc7\u7a0b\uff1a \u7b2c\u4e00\u6b65\uff1a\u51c6\u5907 SQL \u6587\u4ef6 \u786e\u4fdd\u60a8\u62e5\u6709\u8981\u5bfc\u5165\u7684 SQL \u6587\u4ef6\u3002 \u68c0\u67e5\u6587\u4ef6\u5185\u5bb9\u5e76\u786e\u4fdd\u8bed\u6cd5\u6b63\u786e\u65e0\u8bef\u3002 \u7b2c\u4e8c\u6b65\uff1a\u8fde\u63a5\u5230 MySQL \u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5de5\u5177\u6216 GUI \u8fde\u63a5\u5230\u60a8\u7684\u6570\u636e\u5e93\u3002 \u8f93\u5165\u60a8\u7684\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u6570\u636e\u5e93\u540d\u79f0\u3002 \u7b2c\u4e09\u6b65\uff1a\u521b\u5efa\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09 \u5982\u679c\u8981\u5bfc\u5165 SQL \u6587\u4ef6\u5c06\u5bfc\u5165\u7684\u65b0\u6570\u636e\uff0c\u5219\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u636e\u5e93\u3002 \u4f7f\u7528 CREATE DATABASE \u8bed\u53e5\u521b\u5efa\u6570\u636e\u5e93\u3002 \u7b2c\u56db\u6b65\uff1a\u9009\u62e9\u6570\u636e\u5e93 \u4f7f\u7528 USE \u8bed\u53e5\u9009\u62e9\u60a8\u8981\u5bfc\u5165\u6570\u636e\u7684\u76ee\u6807\u6570\u636e\u5e93\u3002 \u7b2c\u4e94\u6b65\uff1a\u5bfc\u5165 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-6468","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6468","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=6468"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6468\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}