{"id":7034,"date":"2022-07-30T14:46:01","date_gmt":"2022-07-30T05:46:01","guid":{"rendered":"https:\/\/www.xenos.jp\/~zen\/blog2\/?p=7034"},"modified":"2022-07-30T14:46:02","modified_gmt":"2022-07-30T05:46:02","slug":"post-7034","status":"publish","type":"post","link":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/2022\/07\/30\/post-7034\/","title":{"rendered":"MySQL\u3067Select\u3057\u305f\u7d50\u679c\u3092CSV\u3067\u30d5\u30a1\u30a4\u30eb\u51fa\u529b\u3059\u308b"},"content":{"rendered":"\n<p>MySQL\u3067Select\u6587\u306e\u7d50\u679c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3059\u306e\u306f\u7c21\u5358\u3060\u3063\u305f\u3002Select\u6587\u306e\u6700\u5f8c\u306b\u300cINTO OUTFILE\u300d\u3067\u30d5\u30a1\u30a4\u30eb\u306e\u51fa\u529b\u30d1\u30b9\u3068\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3060\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM \u30c6\u30fc\u30d6\u30eb\u540d INTO OUTFILE '\u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9';<\/code><\/pre>\n\n\n\n<p>\u305d\u308c\u304b\u3089\u3001\u66f8\u304d\u8fbc\u307f\u5148\u306e\u6a29\u9650\u304c\u306a\u3044\u3068\u3001\u30a8\u30e9\u30fc\u3067\u5931\u6557\u3059\u308b\u3002\u305d\u306e\u5834\u5408\u306f\u3001\u66f8\u304d\u8fbc\u307f\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3059\u308b\u3002\u4e0b\u8a18\u306f\u3001\u5931\u6557\u3057\u305f\u3068\u3053\u308d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@localhost &#91;zen]> select * from item into outfile '\/usr\/home\/zen\/item.csv';\nERROR 1 (HY000): Can't create\/write to file '\/usr\/home\/zen\/item.csv' (Errcode: 13 \"Permission denied\")\nroot@localhost &#91;zen]><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u3067Select\u6587\u306e\u7d50\u679c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3059\u306e\u306f\u7c21\u5358\u3060\u3063\u305f\u3002Select\u6587\u306e\u6700\u5f8c\u306b\u300cINTO OUTFILE\u300d\u3067\u30d5\u30a1\u30a4\u30eb\u306e\u51fa\u529b\u30d1\u30b9\u3068\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3060\u3063\u305f\u3002 \u305d\u308c\u304b\u3089\u3001\u66f8\u304d\u8fbc\u307f\u5148\u306e\u6a29\u9650\u304c\u306a\u3044\u3068\u3001\u30a8\u30e9\u30fc\u3067\u5931 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[38,49],"class_list":["post-7034","post","type-post","status-publish","format-standard","hentry","category-tech-memo","tag-mariadb","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/7034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/comments?post=7034"}],"version-history":[{"count":2,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/7034\/revisions"}],"predecessor-version":[{"id":7057,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/7034\/revisions\/7057"}],"wp:attachment":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/media?parent=7034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/categories?post=7034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/tags?post=7034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}