Access denied for user...sometimes???

Access denied for user...sometimes???

am 21.02.2007 18:23:45 von James Garfield

I've got 5.0.27-standard installed on an Intel Mac, using the
preinstalled version of Apache and my own installation of PHP 4.4.4. I
use this machine for development work and don't make it available to
anyone else. I've got an instance of a PHP application running, and it
works...but not all of the time!!! I created the user that accesses my
MySQL via the following commands;

use [web_db_name];
grant select, insert, update, delete on *.* to '[new_user]'@'%'
identified by '[new_password]';

I'm able to do everything expected from the command line mysql tool, but
on the PHP side it fails more than half of the time:

Warning: mysql_connect() [function.mysql-connect]: Access denied for
user '[new_user]'@'[my_current_dhcp_ip]' (using password: YES) in
/[path]/[to]/[page]/[on]/[server]/index.php on line 66

This leaves the question: since MySQL is behaving normally otherwise,
I'm using a host of '%' and my IP isn't changing, does anybody know what
the problem is with PHP???

TIA,
James




--
The sender of this email subscribes to Perimeter Internetworking's email
anti-virus service. This email has been scanned for malicious code and is
believed
to be virus free. For more information on email security please
visit:
http://www.perimeterusa.com/email-defense-content.html

This communication is
confidential, intended only for the named recipient(s)
above and may contain trade secrets
or other information that is exempt from
disclosure under applicable law. Any use,
dissemination, distribution or
copying of this communication by anyone other than the named
recipient(s) is
strictly prohibited. If you have received this communication in error,
please
delete the email and immediately notify our Command Center at 203-541-3444.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Access denied for user...sometimes???

am 21.02.2007 18:29:24 von Peter Beckman

On Wed, 21 Feb 2007, James Garfield wrote:

> I've got 5.0.27-standard installed on an Intel Mac, using the preinstalled
> version of Apache and my own installation of PHP 4.4.4. I use this machine
> for development work and don't make it available to anyone else. I've got an
> instance of a PHP application running, and it works...but not all of the
> time!!! I created the user that accesses my MySQL via the following commands;
>
> use [web_db_name];
> grant select, insert, update, delete on *.* to '[new_user]'@'%' identified by
> '[new_password]';
>
> I'm able to do everything expected from the command line mysql tool, but on
> the PHP side it fails more than half of the time:
>
> Warning: mysql_connect() [function.mysql-connect]: Access denied for user
> '[new_user]'@'[my_current_dhcp_ip]' (using password: YES) in
> /[path]/[to]/[page]/[on]/[server]/index.php on line 66
>
> This leaves the question: since MySQL is behaving normally otherwise, I'm
> using a host of '%' and my IP isn't changing, does anybody know what the
> problem is with PHP???
>
> TIA,
> James

flush privileges

------------------------------------------------------------ ---------------
Peter Beckman Internet Guy
beckman@purplecow.com http://www.purplecow.com/
------------------------------------------------------------ ---------------

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Access denied for user...sometimes???

am 22.02.2007 08:43:39 von robleyd

Peter Beckman wrote:

> On Wed, 21 Feb 2007, James Garfield wrote:
>
>> I've got 5.0.27-standard installed on an Intel Mac, using the
>> preinstalled version of Apache and my own installation of PHP 4.4.4. I
>> use this machine for development work and don't make it available to
>> anyone else. I've got an instance of a PHP application running, and it
>> works...but not all of the time!!! I created the user that accesses my
>> MySQL via the following commands;
>>
>> use [web_db_name];
>> grant select, insert, update, delete on *.* to '[new_user]'@'%'
>> identified by '[new_password]';
>>
>> I'm able to do everything expected from the command line mysql tool, but
>> on the PHP side it fails more than half of the time:
>>
>> Warning: mysql_connect() [function.mysql-connect]: Access denied for user
>> '[new_user]'@'[my_current_dhcp_ip]' (using password: YES) in
>> /[path]/[to]/[page]/[on]/[server]/index.php on line 66
>>
>> This leaves the question: since MySQL is behaving normally otherwise, I'm
>> using a host of '%' and my IP isn't changing, does anybody know what the
>> problem is with PHP???
>>
>> TIA,
>> James
>
> flush privileges

And, as it's only you using mysql from the current machine, you don't need a
network connection to your own machine - use localhost instead of your
dynamic(?) IP, and set skip-networking (or whatever it is called) to on in
your my.cnf file.




Cheers
--
David Robley

Useless Invention: Checkered paint.
Today is Pungenday, the 53rd day of Chaos in the YOLD 3173.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php