Sending an output of a query to file in debian lenny

Sending an output of a query to file in debian lenny

am 02.12.2010 10:06:21 von bars0 bars0

--0016367fb7eb441917049669bcce
Content-Type: text/plain; charset=UTF-8

Hi everyone!

I try o send an output of a query in debian lenny, using: SELECT....INTO
OUTFILE '/my_path/my_file' FROM...but I get an error: ERROR 1 (HY000): Can't
create/write to file... (Errcode 13).
What's the problem?

--0016367fb7eb441917049669bcce--

Re: Sending an output of a query to file in debian lenny

am 02.12.2010 10:19:31 von Johan De Meersman

--0022152d7fed690005049669ebda
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Dec 2, 2010 at 10:06 AM, bars0 bars0 wrote:

> I try o send an output of a query in debian lenny, using: SELECT....INTO
> OUTFILE '/my_path/my_file' FROM...but I get an error: ERROR 1 (HY000):
> Can't
> create/write to file... (Errcode 13).
> What's the problem?
>

The file is not written as your user, but as the user mysqld runs as. That
user (usually "mysql") need to have the necessary permissions on the
directory/file you write to.



--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--0022152d7fed690005049669ebda--

Re: Sending an output of a query to file in debian lenny

am 02.12.2010 11:05:11 von Simcha

On Thu, 2 Dec 2010 10:06:21 +0100
bars0 bars0 wrote:

> Hi everyone!
>
> I try o send an output of a query in debian lenny, using: SELECT....INTO
> OUTFILE '/my_path/my_file' FROM...but I get an error: ERROR 1 (HY000): Can't
> create/write to file... (Errcode 13).
> What's the problem?

You probably have apparmor installed, and it prevents mysql from writing to any directory other than the mysql data directories, regardless of which user it is running under.


--
Simcha Younger

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Sending an output of a query to file in debian lenny

am 02.12.2010 16:05:46 von bars0 bars0

--001636498bb9ba281c04966ec150
Content-Type: text/plain; charset=UTF-8

2010/12/2 Simcha Younger

> On Thu, 2 Dec 2010 10:06:21 +0100
> bars0 bars0 wrote:
>
> > Hi everyone!
> >
> > I try o send an output of a query in debian lenny, using: SELECT....INTO
> > OUTFILE '/my_path/my_file' FROM...but I get an error: ERROR 1 (HY000):
> Can't
> > create/write to file... (Errcode 13).
> > What's the problem?
>
> You probably have apparmor installed, and it prevents mysql from writing to
> any directory other than the mysql data directories, regardless of which
> user it is running under.
>
>
> --
> Simcha Younger
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=bars0.bars0.bars0@gmail.c om
>
>
Yes, something is certailny wrong, because even when I added in MySQL user
'krzysztof', wchich is similar to regular user of my linux machine, I can't
write output neither to /home nor to /tmp directory.
Only as a root user I can send output into /tmp directory.
Linux host has basic Debian Lenny installation (without X). I will check the
apparmor but I am not sure if it is enabled by default.

--001636498bb9ba281c04966ec150--

Re: Sending an output of a query to file in debian lenny

am 02.12.2010 17:21:19 von Johan De Meersman

--000325550e5adeaea704966fcf54
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Dec 2, 2010 at 4:05 PM, bars0 bars0 wrote:

> Yes, something is certailny wrong, because even when I added in MySQL user
> 'krzysztof', wchich is similar to regular user of my linux machine, I can't
>

MySQL users have nothing to see with OS users. As root, do "su -c /bin/bash
- mysql" and check if you can write to /tmp.


> write output neither to /home nor to /tmp directory.
> Only as a root user I can send output into /tmp directory.
> Linux host has basic Debian Lenny installation (without X). I will check
> the
> apparmor but I am not sure if it is enabled by default.
>



--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--000325550e5adeaea704966fcf54--