{"id":4568,"date":"2019-08-16T23:42:09","date_gmt":"2019-08-16T15:42:09","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4568"},"modified":"2019-08-16T23:42:11","modified_gmt":"2019-08-16T15:42:11","slug":"mysqlimport","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/mysqlimport","title":{"rendered":"mysqlimport\u547d\u4ee4 – MySQL\u670d\u52a1\u5668\u6570\u636e\u5bfc\u5165"},"content":{"rendered":"\n

mysqlimport\u547d\u4ee4\u4e3aMySQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u63d0\u4f9b\u4e86\u4e00\u79cd\u547d\u4ee4\u884c\u65b9\u5f0f\u5bfc\u5165\u6570\u636e\u5de5\u5177\uff0c\u5b83\u4ece\u7279\u5b9a\u683c\u5f0f\u7684\u6587\u672c\u6587\u4ef6\u4e2d\u8bfb\u53d6\u6570\u636e\u63d2\u5165MySQL\u6570\u636e\u5e93\u8868\u4e2d\u3002 <\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f :\u00a0<\/strong>mysqlimport [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-D<\/td>\u5bfc\u5165\u6570\u636e\u524d\u6e05\u7a7a\u8868<\/td><\/tr>
-f<\/td>\u51fa\u73b0\u9519\u8bef\u65f6\u7ee7\u7eed\u5904\u7406\u5269\u4f59\u7684\u64cd\u4f5c<\/td><\/tr>
-h<\/td>MySQL\u670d\u52a1\u5668\u7684ip\u5730\u5740\u6216\u4e3b\u673a\u540d<\/td><\/tr>
-u<\/td>\u8fde\u63a5MySQL\u670d\u52a1\u5668\u7684\u7528\u6237\u540d<\/td><\/tr>
-p<\/td>\u8fde\u63a5MySQL\u670d\u52a1\u5668\u7684\u5bc6\u7801<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u4f7f\u7528mysqlimport\u547d\u4ee4\u50cfMySQL\u670d\u52a1\u5668\u5bfc\u5165\u6570\u636e\u65f6\u9700\u8981\u6ce8\u610f\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\uff0c\u5426\u5219\u53ef\u80fd\u5bfc\u81f4\u5bfc\u5165\u7684\u6570\u636e\u51fa\u73b0\u4e71\u7801\u3002<\/p>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5bfc\u5165\u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mysqlimport -u root --local linuxcool.sql --fields-terminated-by=\"|\"<\/pre>\n\n\n\n

\u5bfc\u5165\u672c\u6587\u5230\u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# [root@linuxcool ~]# mysqlimport -v -u root -p linuxcool_db linuxcool.txt<\/pre>\n","protected":false},"excerpt":{"rendered":"

mysqlimport\u547d\u4ee4\u4e3aMySQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u63d0\u4f9b\u4e86\u4e00\u79cd\u547d\u4ee4\u884c\u65b9\u5f0f\u5bfc\u5165\u6570\u636e\u5de5\u5177\uff0c\u5b83\u4ece\u7279\u5b9a\u683c\u5f0f\u7684\u6587\u672c\u6587\u4ef6\u4e2d\u8bfb […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4568"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=4568"}],"version-history":[{"count":4,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4568\/revisions"}],"predecessor-version":[{"id":4636,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4568\/revisions\/4636"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}