← Back to team overview

maria-developers team mailing list archive

Re: how to use Select INTO OUTFILE

 

Hi!

>>>>> "Irwan" == Irwan  <irwan_forum@xxxxxxxxxxx> writes:

First a quick question, which windows version and which MariaDB
version are you using?

Irwan> how to use into outfile using mariadb to output in specified folder,
Irwan> in mysql i use like this
Irwan> SELECT * from SSD010.mastergudang INTO OUTFILE
Irwan> 'C:/DOCUME~1/USER/LOCALS~1/Temp/17947F77/mastergudang'

Irwan> but ini mariadb
Irwan> SELECT * from SSD010.mastergudang INTO OUTFILE
Irwan> 'C://DOCUME~1//USER//LOCALS~1//Temp//17947F77//mastergudang'

Both MariaDB and MYSQL should use the identical syntax here.

I wonder if this could be a difference in the clients?

What happens if you try to use the MySQL command on windows?

Irwan> the output not correct folder like this
Irwan> http://prntscr.com/wu0n4

The above screen shows that the output is a into a file,

data/DOCUME~1USERLOCALS~1Temp17947F77mastergudang'

MariaDB should be able to use both / and \ on windows.

In fact, our test suite uses '/' for creating files, not '//', so '/'
should work.

Irwan> when i use like this failed,
Irwan> i'm sure the folder exist

Irwan> SELECT * from SSD010.mastergudang INTO OUTFILE
Irwan> 'C:\\DOCUME~1\\USER\\LOCALS~1\\Temp\\17947F77\\mastergudang'

Irwan> http://prntscr.com/wtypr

Errode 13, means 'Access denied'.

So this means probably that the directory exists, but the MariaDB
service doesn't have right to create a file in it.

Wlad, our windows expert says

"I think the service is not allowed to write into users temp
directory, that's it. But some more context need to be given..."

Question from Wlad:

"Is mysqld running as service, and if yes, under which account
(typically for us it is NetworkService)" ?

"As a self-service, first aid to analyze such errors, user can use
https://kb.askmonty.org/en/how-to-use-procmon-to-trace-mysqldexe-filesystem-access/";

Hope the above helps.

Regards,
Monty