You can't do that.  The mysql server runs as user mysql, so it cannot create 
files owned by another user.  If you run the mysql server as root (don't!), 
you might be able to do that, but I do not believe mysql has a facility for 
changing the owner of a file.  You are better off running a script as the 
user you want to own the file and outputing the results via the script.

j----- k-----

On Tuesday 28 February 2006 19:18, unplug wrote:
> Thanks!
> But I want to change the default setting of the file permission and
> ownership.  (i.e. the file will be created with permission and
> ownerhsip according to my setting).
>
> On 3/1/06, CodeHeads <[EMAIL PROTECTED]> wrote:
> > On Tuesday 28 February 2006 22:55, unplug wrote:
> > > Hi,
> > > When I use a query "SELECT * into outfile '/tmp/report.csv' fields
> > > terminated by ',' lines terminated by '\n' FROM table;", it will
> > > create a file with the following permission and owner.
> > >
> > > -rw-rw-rw-   1 mysql mysql  2489 Mar  1 11:30 report.csv
> > >
> > > How can I change the default permission or the ownership of the file?
> > >
> > > Rgds,
> > > unplug
> >
> > chown your_username:your_username report.cvs
> >
> > Of course change the "your_username" to the user you are logged in as.
> >
> > --
> > Best regards,
> > ~WILL~
> > Key: http://code-heads.com/keys/ch1.asc
> > Key: http://code-heads.com/keys/ch2.asc
> > Linux Commands: http://code-heads.com/commands
> > Linux Registered User: 406084 (http://counter.li.org/)
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:   
> > http://lists.mysql.com/[EMAIL PROTECTED]

-- 
Joshua Kugler                 PGP Key: http://pgp.mit.edu/
CDE System Administrator             ID 0xDB26D7CE
http://distance.uaf.edu/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to