[Info-vax] MYSQL OUTFILE on OpenVMS

Paul Sture nospam at sture.ch
Mon Oct 17 11:09:32 EDT 2016


On 2016-10-17, Joe <joslovefun at gmail.com> wrote:
> Hello All,
>
> I'm trying to point OUTFILE of a query to a another directory, I'm not able to figure out what's wrong here.
>
>
> Joe_Engg> write sys$output f$getsyi("version")
> V8.4
>
>
> mysql> SELECT VERSION();
> +------------+
>| VERSION()  |
> +------------+
>| 4.1.14-log |
> +------------+
> 1 row in set (0.02 sec)
>
> mysql> exit
>
>
>
>
> mysql> use vms_sec
> Database changed
> mysql> SELECT * INTO OUTFILE 'DISK$USER:[SYSMGT.Joe]test1.csv' FIELDS
> TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
> FROM prod;
> Query OK, 6849 rows affected (0.27 sec)
>
> mysql>

I always understood that INTO OUTFILE came after the rest of the command:

	SELECT ... FROM ... WHERE ... 
	INTO OUTFILE 'file.csv'
	FIELDS TERMINATED BY ','

>
> The OUTFILE is not going to the path specified in the query. Instead its getting created in the same directory where the database resides.
>
> Joe_Engg> dire webtools:[000000...]*test1*
>
> Directory WEBTOOLS:[MYSQL_DATABASES.MYSQL.DATA]
>
> DISK$USER^:^[SYSMGT^.Joe^]test1.csv;1      1.93MB  17-OCT-2016
> 14:32:10.15  17-OCT-2016 14:32:10.42
>
> Total of 1 file, 1.93MB
> Joe_Engg>

With the OUTPUT INTO syntax the MySQL server process is doing the
output, not your process.  You need to check that the MySQL process has
write access to your directory.

Does the 'tee' command work in your version of MySQL? See "How to log the output from an entire MySQL client session" section here:

<http://alvinalexander.com/mysql/how-save-output-mysql-query-file>

and use 'notee' to switch the logging off.

-- 
My kettle isn't connected to the internet.



More information about the Info-vax mailing list