Sending an output of a query to file in debian lenny

--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--
bars0 bars0 [ Do, 02 Dezember 2010 10:06 ] [ ID #2051152 ]

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

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

On Thu, Dec 2, 2010 at 10:06 AM, bars0 bars0 <bars0.bars0.bars0 [at] gmail.com>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--
Johan De Meersman [ Do, 02 Dezember 2010 10:19 ] [ ID #2051153 ]

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

On Thu, 2 Dec 2010 10:06:21 +0100
bars0 bars0 <bars0.bars0.bars0 [at] gmail.com> 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 <simcha [at] syounger.com>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2 [at] m.gmane.org
Simcha [ Do, 02 Dezember 2010 11:05 ] [ ID #2051154 ]

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

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

2010/12/2 Simcha Younger <simcha [at] syounger.com>

> On Thu, 2 Dec 2010 10:06:21 +0100
> bars0 bars0 <bars0.bars0.bars0 [at] gmail.com> 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 <simcha [at] syounger.com>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=bars0.bars0.bars0 [at] 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--
bars0 bars0 [ Do, 02 Dezember 2010 16:05 ] [ ID #2051156 ]

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

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

On Thu, Dec 2, 2010 at 4:05 PM, bars0 bars0 <bars0.bars0.bars0 [at] gmail.com>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--
Johan De Meersman [ Do, 02 Dezember 2010 17:21 ] [ ID #2051157 ]
Datenbanken » gmane.comp.db.mysql.general » Sending an output of a query to file in debian lenny

Vorheriges Thema: useful MySQL tutorials that I wrote
Nächstes Thema: Log Mysql slow query into table