Francis Mak wrote:
> Hi,
> 
>     sorry if this has been answered previously, however I
> tried to google, I found a few people having this issue, but no
> solutions provided. 
> 
>     I am using PHP4.3.4 + MYSQL 4.1.0-alpha-standard(binary,
> not rpm and not compiled by myself) + REDHAT 9
> 
>     all I did is:
> 
>     grant all on privileges on dbname.* to 'auser'@localhost
>     identified by "pass"; flush privileges;
> 
>     and in my PHP, I provide the correct login, password and using
> 'localhost'. 
> 
>     it works successfully, however, sometimes it just give me "Error
> 1045: Access Denied for user '[EMAIL PROTECTED]'"
>     it happens RANDOMLY.
> 
>     Could anybody please let me know how to fix this???
> 
>     Many thanks.
> 
> Francis

First of all, there was no reason for the "flush privileges;" call. This is
automatically handled by MySQL when you use the GRANT and REVOKE statements.
Doesn't do any harm though ;).

Second, nothing is ever random in a computer. Not even the rand(); function.
When you start realizing that, you will come closer to the solution. What I
expect is that in some script you have mistyped the password or somthing.
Does this message say anything else besides "1045: Access Denied for user
'[EMAIL PROTECTED]'"? Usually it also says: "Using password YES" or "Using
password NO".

So, try to see the logic of this error. Is it always displayed when
executing the same script, are different scripts involved each time. Is the
username the error tells you the same as the username you granted access to?
Are your mysql_connect(); calls complete?

Check all that and report back ;)
Wouter




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to