Re: MySQL Question
| From: | Ryan Adams | Date: | Wed, 14 Jun 2000 21:14:37 +0000 |
| Subject: | Re: MySQL Question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1871@lists.php.net to get a copy of this message | ||
Heh...
If you decide to run mysql as root anyway I've got a file that you need to put
on there...
;)
Ryan
On Wed, Jun 14, 2000 at 03:00:24PM -0600, Jason wrote:
> I found out the problem was a MySQL permissions issue. To read or write an
> external file, the FILE option must be granted. This is not given with the
> "GRANT ALL ON" statement. However, I read that this brings up security
> issues specifically if MySQL runs as root. This would give the user the
> ability to read and write files as root, which is a bad thing. This is an
> easy problem to fix with PHP though. All the query does is redirect the
> data from a select statement to a file in /tmp. PHP could do this easily
> instead.
>
> Jason
>
> > -----Original Message-----
> > From: Ryan Adams [mailto:radams@fcs.uga.edu]
> > Sent: Wednesday, June 14, 2000 2:49 PM
> > To: Jason
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP-GENERAL] MySQL Question
> >
> >
> > Sounds like a mysql access problem to me.
> >
> > How are you connecting to the db from the script?
> >
> > Ryan
> >
> > On Wed, Jun 14, 2000 at 11:38:30AM -0600, Jason wrote:
> > > This question is more related to MySQL than PHP I think.
> > >
> > > I'm trying to execute the following statement from PHP:
> > > select * into outfile '/tmp/students.csv' fields terminated by
> > > '|' from comments;
> > >
> > > When I run this query as the DB owner, I get the following error:
> > > ERROR 1045: Access denied for user: 'hoster@localhost' (Using
> > > password: YES)
> > >
> > > The password is correctly specified.
> > >
> > > When I run the same query as the superuser "root", it executes
> > > successfully. I've read that a user has to have FILE permission
> > > granted which the user "hoster" has. I get the same error if I
> > > try the statement via command line as well. Any ideas?
> > >
> > > Jason
> > >
> > > _______________________________________________________
> > > Site Design, Hosting, and E-Commerce at www.webpipe.net
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> > ---end quoted text---
> >
>
>
> _______________________________________________________
> Site Design, Hosting, and E-Commerce at www.webpipe.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
---end quoted text---