
{"id":864,"date":"2019-06-29T14:32:29","date_gmt":"2019-06-29T17:32:29","guid":{"rendered":"http:\/\/rodrigosilvaesilva.com.br\/?p=864"},"modified":"2019-06-29T14:32:29","modified_gmt":"2019-06-29T17:32:29","slug":"error-1290-hy000-the-mysql-server-is-running-with-the-secure-file-priv-option-so-it-cannot-execute-this-statement","status":"publish","type":"post","link":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/2019\/06\/29\/error-1290-hy000-the-mysql-server-is-running-with-the-secure-file-priv-option-so-it-cannot-execute-this-statement\/","title":{"rendered":"ERROR 1290 (HY000): The MySQL server is running with the &#8211;secure-file-priv option so it cannot execute this statement"},"content":{"rendered":"<p>ERROR 1290 ao exportar para .csv<\/p>\n<pre class=\"lang:mysql decode:true \">mysql&gt; SELECT * FROM alunos\n\t\tINTO OUTFILE '\/tmp\/alunos.csv'\n\t\tFIELDS ENCLOSED BY '\"'\n\t\tTERMINATED BY ';'\n\t\tESCAPED BY '\"'\n\t\tLINES TERMINATED BY '\\r\\n';\nERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement<\/pre>\n<p>Edite o arquivo \/etc\/my.cnf<\/p>\n<p>Adicione a linha<\/p>\n<pre class=\"lang:sh decode:true\">secure-file-priv = \"\"\n<\/pre>\n<p>Exportando novamente<\/p>\n<pre class=\"lang:mysql decode:true\">mysql&gt; SELECT * FROM alunos\n    -&gt; INTO OUTFILE '\/tmp\/alunos.csv'\n    -&gt; FIELDS ENCLOSED BY '\"'\n    -&gt; TERMINATED BY ';'\n    -&gt; ESCAPED BY '\"'\n    -&gt; LINES TERMINATED BY '\\r\\n';\nQuery OK, 8000 rows affected (0.00 sec<\/pre>\n<p>&nbsp;<\/p>\n<p>Resolvido!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ERROR 1290 ao exportar para .csv mysql&gt; SELECT * FROM alunos INTO OUTFILE &#8216;\/tmp\/alunos.csv&#8217; FIELDS ENCLOSED BY &#8216;&#8221;&#8216; TERMINATED BY &#8216;;&#8217; ESCAPED BY &#8216;&#8221;&#8216; LINES TERMINATED BY &#8216;\\r\\n&#8217;; ERROR 1290 (HY000): The MySQL server is running with the &#8211;secure-file-priv option so it cannot execute this statement Edite o arquivo \/etc\/my.cnf Adicione a linha secure-file-priv =&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[128],"class_list":["post-864","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-error-1290-hy000-the-mysql-server-is-running-with-the-secure-file-priv-option-so-it-cannot-execute-this-statement"],"_links":{"self":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts\/864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=864"}],"version-history":[{"count":0,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts\/864\/revisions"}],"wp:attachment":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}