{"id":27662,"date":"2024-11-24T11:59:24","date_gmt":"2024-11-24T03:59:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27662\/"},"modified":"2024-11-24T11:59:24","modified_gmt":"2024-11-24T03:59:24","slug":"jdbc-%e8%bf%9e%e6%8e%a5-mysql-%e6%97%a0%e6%b3%95%e4%bd%bf%e7%94%a8-load-data-%e5%91%bd%e4%bb%a4%ef%bc%8c%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27662\/","title":{"rendered":"JDBC \u8fde\u63a5 MySQL \u65e0\u6cd5\u4f7f\u7528 LOAD DATA \u547d\u4ee4\uff0c\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173130300413401.jpg\" class=\"aligncenter\" title=\"JDBC \u8fde\u63a5 MySQL \u65e0\u6cd5\u4f7f\u7528 LOAD DATA \u547d\u4ee4\uff0c\u600e\u4e48\u529e\uff1f\u63d2\u56fe\" alt=\"JDBC \u8fde\u63a5 MySQL \u65e0\u6cd5\u4f7f\u7528 LOAD DATA \u547d\u4ee4\uff0c\u600e\u4e48\u529e\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>JDBC \u8fde\u63a5 MySQL \u65e0\u6cd5\u4f7f\u7528 LOAD DATA \u95ee\u9898\u89e3\u7b54<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 JDBC \u8fde\u63a5 MySQL \u65f6\uff0c\u5982\u679c\u9047\u5230 &#8220;The used command is not allowed with this MySQL version&#8221; \u9519\u8bef\uff0c\u5e76\u4e14\u5df2\u7ecf\u5c06 local_infile \u8bbe\u7f6e\u4e3a true\uff0c\u4f46\u4ecd\u7136\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u90a3\u4e48\u53ef\u80fd\u662f\u56e0\u4e3a JDBC \u8fde\u63a5 URL \u4e2d\u7f3a\u5c11\u4e86\u4e00\u4e2a\u5fc5\u8981\u7684\u53c2\u6570\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u5728 JDBC \u8fde\u63a5 URL \u4e2d\u6dfb\u52a0\u53c2\u6570 allowLoadLocalInfile=true\u3002\u8fd9\u6837\uff0cJDBC \u8fde\u63a5\u5c06\u5141\u8bb8\u4f7f\u7528 LOAD DATA \u547d\u4ee4\u3002<\/p>\n<p>\u901a\u5e38\uff0c\u5728 Navicat \u7b49\u7b2c\u4e09\u65b9\u5ba2\u6237\u7aef\u4e2d\uff0cLOAD DATA \u547d\u4ee4\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\uff0c\u4f46\u4f7f\u7528 JDBC \u8fde\u63a5\u65f6\u5374\u4f1a\u51fa\u73b0\u95ee\u9898\u3002\u8fd9\u662f\u56e0\u4e3a Navicat \u53ef\u80fd\u4f1a\u81ea\u52a8\u6dfb\u52a0 allowLoadLocalInfile=true \u53c2\u6570\uff0c\u800c JDBC \u8fde\u63a5\u5219\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u8be5\u53c2\u6570\u3002<\/p>\n<p>\u6dfb\u52a0 allowLoadLocalInfile=true \u53c2\u6570\u540e\uff0cJDBC \u8fde\u63a5\u5e94\u8be5\u5c31\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528 LOAD DATA \u547d\u4ee4\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fJDBC \u8fde\u63a5 MySQL \u65e0\u6cd5\u4f7f\u7528 LOAD DATA \u547d\u4ee4\uff0c\u600e\u4e48\u529e\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JDBC \u8fde\u63a5 MySQL \u65e0\u6cd5\u4f7f\u7528 LOAD DATA \u95ee\u9898\u89e3\u7b54 \u5728\u4f7f\u7528 JDBC \u8fde\u63a5 MySQL \u65f6\uff0c\u5982\u679c\u9047\u5230 &#8220;The used command is not allowed with this MySQL version&#8221; \u9519\u8bef\uff0c\u5e76\u4e14\u5df2\u7ecf\u5c06 local_infile \u8bbe\u7f6e\u4e3a true\uff0c\u4f46\u4ecd\u7136\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u90a3\u4e48\u53ef\u80fd\u662f\u56e0\u4e3a JDBC \u8fde\u63a5 URL \u4e2d\u7f3a\u5c11\u4e86\u4e00\u4e2a\u5fc5\u8981\u7684\u53c2\u6570\u3002 \u89e3\u51b3\u65b9\u6cd5\uff1a\u5728 JDBC \u8fde\u63a5 URL \u4e2d\u6dfb\u52a0\u53c2\u6570 allowLoadLocalInfile=true\u3002\u8fd9\u6837\uff0cJDBC \u8fde\u63a5\u5c06\u5141\u8bb8\u4f7f\u7528 LOAD DATA \u547d\u4ee4\u3002 \u901a\u5e38\uff0c\u5728 Navicat \u7b49\u7b2c\u4e09\u65b9\u5ba2\u6237\u7aef\u4e2d\uff0cLOAD DATA \u547d\u4ee4\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\uff0c\u4f46\u4f7f\u7528 JDBC \u8fde\u63a5\u65f6\u5374\u4f1a\u51fa\u73b0\u95ee\u9898\u3002\u8fd9\u662f\u56e0\u4e3a Navicat \u53ef\u80fd\u4f1a\u81ea\u52a8\u6dfb\u52a0 allowLoadLocalInfile=true \u53c2\u6570\uff0c\u800c JDBC \u8fde\u63a5\u5219\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u8be5\u53c2\u6570\u3002 \u6dfb\u52a0 allowLoadLocalInfile=true [&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-27662","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27662","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=27662"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27662\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}