- I am 100% sure that all scripts are using include ("db.php");
so all pages are using the same login and password and hostname

- since I am using password, so it shows "Using Password YES" as well.

- The error indeed occured on the same page. e.g. when you are viewing
index.php, it may run successfully.  and you keep on refreshing your browser
on the same page, 'sometimes' it will show the error.

for your ref., below are the connect function used in my db.php(which is
just a very common function):

        $dbhost="localhost";
        $dbuser="auser";
        $dbpwd="pass";
        $dbname="dbname";

        function connectdb(){
                global $dbhost, $dbuser, $dbpwd, $dbname;
                ($dbname) ? $dbname : $dbname = $dbuser;
                $dbh = mysql_connect($dbhost, $dbuser, $dbpwd)
                        or die("Failed to connect database server ".mysql_error()."
".mysql_errno());
                mysql_select_db("$dbname")
                        or die("Unable to select database");
                return $dbh;
        }

thanks!!

Wouter, you replied so quick, ;)

of course I won't do blank password in a production server. But just wanna
know it is a problem in 4.1-alpha or not.
and I will try to "regrant" by using the statement you gave me.  thanks.
see another thread about this:
http://groups.google.com/groups?hl=zh-TW&lr=&ie=UTF-8&oe=UTF-8&threadm=bkeab
v%241bq6%241%40FreeBSD.csie.NCTU.edu.tw


-----Original Message-----
From: Wouter van Vliet [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 8:16 PM
To: 'Francis Mak'; [EMAIL PROTECTED]
Subject: RE: error 1045 happened randomly


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