[KLUG Members] Re: mysql writes to a file with root permissions

Patrick McGovern members@kalamazoolinux.org
Thu, 18 Apr 2002 14:15:41 -0400


--=_A0FD2E46.4E2F6F88
Content-Type: text/plain; charset=ISO-8859-7
Content-Transfer-Encoding: quoted-printable

>>> b.j.smith@ieee.org 04/18/02 12:15PM >>>
On Thu, 2002-04-18 at 09:06, Patrick McGovern wrote:
> >I am using a mysql one line command within a shell script.  It
> >extracts data from an sql script and the output is redirected to
> >a file.  The output file has root permissions yet the username for
> >the mysql command is not root.  Is there a way to have mysql set the
> >permissions to allow user access to that file?

>Sounds like you're running that script as root, instead of the mysql
>user.

I don't have access to the script right now (it's at home), but it sounds
like I goofed and this is not an expected mysql behavior.

>Are you calling it via cronjob?  If so, you need to make sure you run it
>from mysql's crontab, and not roots.
>I.e., run "crontab -e" as the mysql user, not root.=AF
>--Bryan

I am glad you mentioned this.  I expect to use this feature later.
Pat

--=_A0FD2E46.4E2F6F88
Content-Type: text/html; charset=ISO-8859-7
Content-Transfer-Encoding: quoted-printable
Content-Description: HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type=
>
<META content=3D"MSHTML 5.00.3314.2100" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT: 8pt MS Sans Serif; MARGIN-LEFT: 2px; MARGIN-TOP: =
2px">
<DIV>&gt;&gt;&gt; b.j.smith@ieee.org 04/18/02 12:15PM &gt;&gt;&gt;<BR>On =
Thu,=20
2002-04-18 at 09:06, Patrick McGovern wrote:<BR>&gt; &gt;I am using a =
mysql one=20
line command within a shell script.&nbsp; It<BR>&gt; &gt;extracts data =
from an=20
sql script and the output is redirected to<BR>&gt; &gt;a file.&nbsp; The =
output=20
file has root permissions yet the username for<BR>&gt; &gt;the mysql =
command is=20
not root.&nbsp; Is there a way to have mysql set the<BR>&gt; &gt;permission=
s to=20
allow user access to that file?<BR><BR>&gt;Sounds like you're running =
that=20
script as root, instead of the mysql<BR>&gt;user.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I don't have access to the script right now (it's at home), but it=20
sounds</DIV>
<DIV>like I goofed and this is not an expected mysql behavior.</DIV>
<DIV><BR>&gt;Are you calling it via cronjob?&nbsp; If so, you need to make =
sure=20
you run it<BR>&gt;from mysql's crontab, and not roots.<BR>&gt;I.e., run =
"crontab=20
-e" as the mysql user, not root.&#8212;</DIV>
<DIV>&gt;--Bryan</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am glad you mentioned this.&nbsp; I expect to use this feature=20
later.</DIV>
<DIV>Pat</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

--=_A0FD2E46.4E2F6F88--