{"id":27879,"date":"2024-11-24T08:47:28","date_gmt":"2024-11-24T00:47:28","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27879\/"},"modified":"2024-11-24T08:47:28","modified_gmt":"2024-11-24T00:47:28","slug":"%e4%bd%bf%e7%94%a8jdbc%e8%bf%9e%e6%8e%a5mysql%e6%97%b6%ef%bc%8cload-data%e5%a4%b1%e8%b4%a5%e7%9a%84%e5%8e%9f%e5%9b%a0%e5%92%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27879\/","title":{"rendered":"\u4f7f\u7528JDBC\u8fde\u63a5MySQL\u65f6\uff0c\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173132753026920.jpg\" class=\"aligncenter\" title=\"\u4f7f\u7528JDBC\u8fde\u63a5MySQL\u65f6\uff0c\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"\u4f7f\u7528JDBC\u8fde\u63a5MySQL\u65f6\uff0c\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>jdbc\u8fde\u63a5\u65f6\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u89e3\u51b3\u65b9\u6cd5<\/strong><\/p>\n<p>\u5728\u4f7f\u7528jdbc\u8fde\u63a5mysql\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4f7f\u7528\u201cload data\u201d\u547d\u4ee4\u5931\u8d25\u7684\u95ee\u9898\uff0c\u5e76\u63d0\u793a\u201cthe used command is not allowed with this mysql version\u201d\u9519\u8bef\u4fe1\u606f\u3002\u8fd9\u662f\u56e0\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cmysql\u4e0d\u652f\u6301jdbc\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u6587\u4ef6\u3002<\/p>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u9700\u8981\u5728jdbc url\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u989d\u5916\u7684\u53c2\u6570\uff1aallowloadlocalinfile=true\u3002\u6b64\u53c2\u6570\u5141\u8bb8jdbc\u901a\u8fc7\u7f51\u7edc\u52a0\u8f7d\u672c\u5730\u6587\u4ef6\u3002\u6dfb\u52a0\u8be5\u53c2\u6570\u540e\u7684jdbc url\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre>jdbc:mysql:\/\/host:port\/database_name?allowLoadLocalInfile=true<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6dfb\u52a0\u6b64\u53c2\u6570\u540e\uff0c\u5373\u53ef\u6b63\u5e38\u6267\u884c\u201cload data\u201d\u547d\u4ee4\u3002\u5728mysql \u7b49\u56fe\u5f62\u5316\u5de5\u5177\u4e2d\uff0c\u901a\u5e38\u4f1a\u81ea\u52a8\u8bbe\u7f6e\u6b64\u53c2\u6570\uff0c\u4f46\u5728\u4f7f\u7528jdbc\u8fde\u63a5\u65f6\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528JDBC\u8fde\u63a5MySQL\u65f6\uff0c\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u5982\u4f55\u89e3\u51b3\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\u65f6\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u89e3\u51b3\u65b9\u6cd5 \u5728\u4f7f\u7528jdbc\u8fde\u63a5mysql\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4f7f\u7528\u201cload data\u201d\u547d\u4ee4\u5931\u8d25\u7684\u95ee\u9898\uff0c\u5e76\u63d0\u793a\u201cthe used command is not allowed with this mysql version\u201d\u9519\u8bef\u4fe1\u606f\u3002\u8fd9\u662f\u56e0\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cmysql\u4e0d\u652f\u6301jdbc\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u6587\u4ef6\u3002 \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u9700\u8981\u5728jdbc url\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u989d\u5916\u7684\u53c2\u6570\uff1aallowloadlocalinfile=true\u3002\u6b64\u53c2\u6570\u5141\u8bb8jdbc\u901a\u8fc7\u7f51\u7edc\u52a0\u8f7d\u672c\u5730\u6587\u4ef6\u3002\u6dfb\u52a0\u8be5\u53c2\u6570\u540e\u7684jdbc url\u793a\u4f8b\u5982\u4e0b\uff1a jdbc:mysql:\/\/host:port\/database_name?allowLoadLocalInfile=true \u767b\u5f55\u540e\u590d\u5236 \u6dfb\u52a0\u6b64\u53c2\u6570\u540e\uff0c\u5373\u53ef\u6b63\u5e38\u6267\u884c\u201cload data\u201d\u547d\u4ee4\u3002\u5728mysql \u7b49\u56fe\u5f62\u5316\u5de5\u5177\u4e2d\uff0c\u901a\u5e38\u4f1a\u81ea\u52a8\u8bbe\u7f6e\u6b64\u53c2\u6570\uff0c\u4f46\u5728\u4f7f\u7528jdbc\u8fde\u63a5\u65f6\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u3002 \u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528JDBC\u8fde\u63a5MySQL\u65f6\uff0c\u201cload data\u201d\u5931\u8d25\u7684\u539f\u56e0\u548c\u5982\u4f55\u89e3\u51b3\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27879","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27879","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=27879"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27879\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}