35 questions
0
votes
0
answers
13
views
ERROR 1 (HY000): Can't create/write to file 'xxxx.csv' (OS errno 2 - No such file or directory) [duplicate]
Trying to export table data using below mysql statement in Windows 10 OS:
mysql> SELECT * FROM classicmodels.customers
-> INTO OUTFILE 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\xxx.csv'
...
0
votes
0
answers
46
views
Encrypt file from Aurora to S3 using SSE-KMS
I'm using SELECT INTO OUTFILE S3 to move data from Amazon Aurora to S3. The file needs to be encrypted using a KMS key I generated (customer managed).
I'm using OUTFILE S3 command but getting this ...
0
votes
1
answer
99
views
Write a script to sort words in alphabet order from specific file and put them into 26 text files named A.txt, B.txt, and so on up to Z.txt
I need to sort words alphabetically from a specific file and put them into 26 text files named A.txt, B.txt and so on up to Z.txt.
$Content = Get-Content ".\\1.txt"
$Content = ($Content....
0
votes
1
answer
290
views
powershell out-file writing zero bytes
I am trying to export the SQL Server query results chunks in to .json file. Here I have large table around the 90GB I need to automate the script using the pagination approach.
The following ...
1
vote
1
answer
52
views
weekly event select into file with different filenames depending on the variables(MariaDB)
I've always been a silent reader here until now.
Now I would like to ask for your expertise and post my ver first question here.
I have to achieve the following task on a weekly basis in my MariaDB ...
0
votes
0
answers
80
views
MYSQL - Export data into outfile with pivot-table query
I wrote a script that gather the space used by multiple datasets.
My database looks like the below:
Date_and_Time
Server_Name_and_Drive
Space_Used_(Gb)
08/04 00:00
SERVER3 D DRIVE
220
08/04 00:00
...
0
votes
1
answer
42
views
writing to a data outfile mysql
This is a bit confusing to me. I am trying to export records out of my database into a csv file using mysql on AWS.
I do the select:
select BusinessName into outfile '/tmp/test.csv' from contractors ...
0
votes
0
answers
341
views
in ms access how to export a query to a textfile programattically
I am looking for a way to export a query or table to a text file in Microsoft Access programmatically. That is not using the export wizard. I found examples from other databases (ref below), but when ...
3
votes
3
answers
7k
views
MySQLdump with WINDOWS10 : OS errno 13 - (Permission denied) when executing 'SELECT INTO OUTFILE'
I am unable to write tab separated text files into specified TSV/ folder using mysqldump on WINDOWS10 (MySQL80 service).
The Command prompt (or powershell) is in admin mode.
secure-file-priv ="" in ...
2
votes
1
answer
280
views
How to import certain data from file on AWS Aurora
Problem: I have an Aurora RDS database that has a table where the data for a certain column was deleted. I have a snapshot of the DB from a few days ago that I want to use to populate the said column ...
0
votes
1
answer
295
views
Pass outfile FILE_PATH as parameter when exporting CSV from MySQL query
How do I pass the outfile file path to MySQL? I have tried the below. It does not work.
My SQL file
SET @query = CONCAT('SELECT *
FROM
`registered_user`
INTO OUTFILE ',@output_location,' FIELDS ...
0
votes
1
answer
59
views
MySQL: wiered chopping for string when using "SELECT INTO OUTFILE"
I exported two fields: name and header from the database using:
SELECT name, header
INTO OUTFILE '/var/lib/mysql-files/myfile.txt'
FIELDS TERMINATED BY '<xx>'
LINES TERMINATED BY '\n'
FROM ...
0
votes
1
answer
2k
views
Use LOAD DATA INFILE and SELECT INTO OUTFILE in Cloud SQL
I am testing Google Cloud SQL and I have to test the instructions LOAD DATA INFILE and SELECT...INTO OUTFILE.
I understood that the instruction LOAD DATA LOCAL INFILE could be used instead of LOAD ...
1
vote
1
answer
413
views
Error Code: 1290. The MySQL server is running with the --secure-file-priv option
This has really been annoying me. I am using MySQL on a Windows computer.
The MySQL statement that I am trying to run is as follows:
SELECT tempInfo.clientName FROM tempInfo LIMIT 1 INTO OUTFILE '...
1
vote
1
answer
47
views
Unable to download database as CSV [duplicate]
Im trying to download a whole database but i keep getting the error:
Parse error: syntax error, unexpected '' LINES TERMINATED BY ''
(T_CONSTANT_ENCAPSED_STRING) in C:\wamp64\www\cookies\...
0
votes
1
answer
149
views
ErrCode with "Select Into Outfile with a variable" - Confusing Permissions
Background: I work with phpMyAdmin (MySQL Workbench) in a mysql DB. I write some PHP code to import data in the DB and execute this with the task scheduler of windows. <= this works fine!
Now I ...
3
votes
2
answers
3k
views
Where does MariaDB `mysql` client save the output file of a select statement?
From this documentation: https://mariadb.com/kb/en/library/select-into-outfile/
I ran
MariaDB []> select ... into outfile 'leads_ny.csv';
Query OK, 6674 rows affected (0.47 sec)
Now I can't ...
3
votes
2
answers
3k
views
Export data from Amazon Aurora to S3 using outfile?
I am trying to export data from a table in my Aurora database to a bucket I have created in my S3, using the "SELECT INTO OUTFILE S3" command that is promoted by Amazon here.
Select * from ...
3
votes
1
answer
922
views
Mysql How to outfile in csv format, with sheets options?
I want to export data from mysql into a csv. There are many tables so I want a csv file with many sheets. How it can be done?
I suppose somethings like:
SELECT *
FROM product
WHERE active = 1
INTO ...
0
votes
2
answers
467
views
MySQL export into Outfile issue
I created a Stored procedure with a cursor in order to get the info from a few tables into a temp table and then export the result into multiple files, one for each Client ID, the cursor and the loop ...
0
votes
0
answers
61
views
 is getting added in the last line of file while fetching data from mysql "INTO OUTFILE" query
I have written a mysql query which selects some rows from a table depending on a condition and writes it to a txt file. But i realized, its inserting a set of additional characters in the last line ...
0
votes
1
answer
236
views
Is there anyway to check the execution time(elapsed or remaining) for the "SELECT... INTO OUTFILE" in php mysql?
I am writing a query, which fetches many millions of rows from a table and puts in to a txt file.
$sQuery = " ( ";
$sQuery .= " SELECT number ";
$sQuery .= " INTO OUTFILE '".$...
1
vote
1
answer
1k
views
Difference in "fields eclosed by" and "fields optionally escaped by"
In MySQL there are two options for the SELECT INTO OUTFILE command:
--fields-enclosed-by=char
--fields-optionally-enclosed-by=char
What's the basic difference in these two options?
Enclosed by ...
0
votes
2
answers
2k
views
phpMyAdmin SQL Error Unrecognized keyword near FIELDS
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 ','
...
0
votes
0
answers
50
views
exporting data from table to .csv file
I'm trying to load data of a table into a csv file. However rows in file are broken in between. The data of table seems fine and there is no \n anywhere. Then why am I getting breaks in rows?
Query I'...
0
votes
1
answer
1k
views
SELECT ... INTO OUTFILE performance
I am trying to optimize the export process of a query.
I have the following tables (I omit some irrelevant fields):
CREATE TABLE _termsofuse (
ID int(11) NOT NULL AUTO_INCREMENT, TTC_ART_ID int(11)...
20
votes
4
answers
42k
views
MySQL exporting INTO OUTFILE --secure-file-priv error when using set directory
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 ...
2
votes
1
answer
426
views
SELECT * FROM .. INTO OUTFILE and save on hosting or send FTP - HOW TO?
I need help. When I try this - SELECT * FROM .. INTO OUTFILE - on local, everything is ok. When I try it on my hosting, I receive error message #1045 - Access denied for user '..'@'%' (using password: ...
1
vote
1
answer
171
views
Automated database backup using PHP event
I'm assigned with a task of creating an automated backup for a database. I used a php event and I want to save my all my backups by a unique name. So I used a date_format and following is my code.
...
2
votes
2
answers
2k
views
MySQL: SELECT * INTO OUTFILE returns always empty array and no error_code?
I'm trying to dump a table into a MySQL file using PHP.
But what I get is an empty array, and not any file is created. While if I remove the instruction " INTO OUTFILE '$mysqldumpfile'", everything ...
3
votes
3
answers
2k
views
mysql select into outfile without any line termination character
I try to print all the data from one field from a table into a file witout any line/field termination character. I would simply like to have all the rows concatenated and printed as one line in the ...
1
vote
1
answer
2k
views
MySQL into outfile formatting
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?
-2
votes
1
answer
395
views
select into oufile does not work
Why would the following query appear to run but I never can find the file outfile?
select *
INTO OUTFILE 'outfile.csv'
FIELDS TERMINATED by ','
LINES TERMINATED BY '\n'
...
0
votes
3
answers
394
views
CSV export without MYSQL FILE functions
i'd like to make an export into CSV format, but the mutualised host i use has deactivate the FILE functions in mysql.
I did a simple SELECT and then a fopen and fwrite with PHP.
The problem is that ...
1
vote
1
answer
2k
views
SELECT INTO OUTFILE - Can't create/write to file
This query:
SELECT ... INTO OUTFILE '/usr/services/001/tmp/`database4ed78d1eb0986`.`tblTemporaryReportFinishedOrders`.tmp';
Produces this error:
Error Code: 1. Can't create/write to file '/usr/...