select-into-outfile

MySQL exporting INTO OUTFILE --secure-file-priv error when using set directory

守給你的承諾、 提交于 2020-03-13 04:24:13
问题 I'm trying to run the following on a MySQL database: SELECT * FROM mysql.db INTO OUTFILE "C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\db.csv" FIELDS TERMINATED BY '|' ENCLOSED BY '"' LINES TERMINATED BY '\n'; I get the error: SQL Error (1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement When I run the following: mysql> SELECT @@secure_file_priv; I get: +------------------------------------------------+ | @@secure_file_priv | +----------

MySQL exporting INTO OUTFILE --secure-file-priv error when using set directory

旧街凉风 提交于 2020-03-13 04:24:10
问题 I'm trying to run the following on a MySQL database: SELECT * FROM mysql.db INTO OUTFILE "C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\db.csv" FIELDS TERMINATED BY '|' ENCLOSED BY '"' LINES TERMINATED BY '\n'; I get the error: SQL Error (1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement When I run the following: mysql> SELECT @@secure_file_priv; I get: +------------------------------------------------+ | @@secure_file_priv | +----------

phpMyAdmin SQL Error Unrecognized keyword near FIELDS

时光总嘲笑我的痴心妄想 提交于 2020-01-24 00:23:18
问题 I'm trying to execute this MySQL to import some data into a csv file. SELECT * FROM purchase WHERE purchase.PO_DATE >= '1-1-2016' INTO OUTFILE "D:\\Reports\\Jan.csv" FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' But I'm receiving the output Static analysis: 11 errors were found during analysis. Unrecognized keyword. (near "FIELDS" at position 99) Unrecognized keyword. (near "TERMINATED" at position 106) Unrecognized keyword. (near "BY" at position 117) Unexpected token.

MySQL into outfile formatting

女生的网名这么多〃 提交于 2019-12-08 08:28:28
select * INTO OUTFILE 'outfile.txt' FIELDS TERMINATED by ',' LINES TERMINATED BY '\n' from nGrams Is there any way I can modify this query to return each row on one line? Seems like thats exactly what it would do already. However, if you are doing this on Windows, you might want to use LINES TERMINATED BY '\r\n' or some crappy text editors (e.g. notepad) might not see \n by itself as a line break 来源: https://stackoverflow.com/questions/13750970/mysql-into-outfile-formatting

MySQL into outfile formatting

六眼飞鱼酱① 提交于 2019-12-08 03:36:39
问题 select * INTO OUTFILE 'outfile.txt' FIELDS TERMINATED by ',' LINES TERMINATED BY '\n' from nGrams Is there any way I can modify this query to return each row on one line? 回答1: Seems like thats exactly what it would do already. However, if you are doing this on Windows, you might want to use LINES TERMINATED BY '\r\n' or some crappy text editors (e.g. notepad) might not see \n by itself as a line break 来源: https://stackoverflow.com/questions/13750970/mysql-into-outfile-formatting