Martin,

Have you defined a user? Because Windows automatically uses
'ODBC'@'localhost' as a standard account, when there is no username
submitted. According to
http://www.php.net/manual/en/function.mysql-errno.php the mysql-errno
function should still work. But it might be interesting to know which
versions you are using and maybe even a part of your sourcecode, so it
is possible to reproduce and debug it.

With regards,
Arjan.


PS: ODBC stands for Open DataBase Connectivity and as far as I know it
is not operating system dependent.

-----Original Message-----
From: Martin Olsson [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 21, 2005 11:09 PM
To: mysql@lists.mysql.com
Subject: 'ODBC'@'localhost' instead of 'root'@'invalid_hostname.com'
?!??

Hi,

I'm using PHP/MySQL to development a web-based application. I just
upgraded both PHP and MySQL and I noticed that some of my MySQL calls
are now broken and I don't see any easy way to fix them.

My script calls mysql_connect() and does very careful error checking. 
It's important that I can tell apart invalid hostname errors from say
incorrect username/password errors. Previously, I did this by checking
mysql_errno(), where 2003 would mean bad hostname and 1045 would
indicate bad username/password.

In the latest PHP/MySQL bundle I downloaded this functionality changed
though. In this new version, whenever I feed it with a invalid hostname
it will fallback to localhost (where I actually have a database running)
and then it will subsequently report a 1045 instead of a 2003.

Oddly enough, the exact error message (mysql_error) I get attached to
this 1045 says; mysql_error()==

Access denied for user 'ODBC'@'localhost' (using password: NO)

Now, what is this about? I sure did not feed it with a username 'ODBC'. 
I do use Windows 2005 but how could ODBC possibly be related to this? (I
assume ODBC means that [Microsoft?] database connection thing, I'm not
sure exactly what is it; i've never used it). For the record, the actual
username I specified in the call with the invalid hostname was "root".

---

So, the question is how can I tell these errors apart?

Why is mysql_error() reporting back that it tried to connect to
localhost as user "ODBC" when I asked it to connect to an invalid
hostname as user "root" ?!?!



sincerly,
martin


-- 
The information contained in this communication and any attachments is 
confidential and may be privileged, and is for the sole use of the intended 
recipient(s). Any unauthorized review, use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify the sender 
immediately by replying to this message and destroy all copies of this message 
and any attachments. ASML is neither liable for the proper and complete 
transmission of the information contained in this communication, nor for any 
delay in its receipt.

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

Reply via email to