Bug #37727 [MySQL][ODBC 5.1 Driver]Access denied for user 'ODBC'@'localhost' (using passwor
Submitted: 29 Jun 2008 16:37 Modified: 30 May 2013 6:36
Reporter: shaun neal Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1 OS:Microsoft Windows (2003 Server IIS 6.0)
Assigned to: CPU Architecture:Any
Tags: ASP, connection string, DSN, ODBC

[29 Jun 2008 16:37] shaun neal
When using a connection string to connect to MySQL Server 5.0.51b, ODBC 5.1 driver gives error of "Access denied" if using a DSN connection string.  Identical settings given in detailed connection string works ok.

in an ASP page:

dim adoConn
dim adoRS

set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")

adoConn.Open "DSN=MyDataSource"   <-- this will give error

adoConn.Open "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=MyDatabase; User=user;Password=pass;Option=3;"     <-- this does not give error

The definition for MyDataSource is configured in the System DSN of the ODBC control panel and is identical to the parameters given in the connection string.

Connection to MySQL Server 5.0.22 works in either instance.

How to repeat:
install 5.0.51b on Windows 2003 server with IIS

create an ASP page with the code above- substitute parameters as needed

create a system DSN with the proper parameters to connecto to your test database

access the ASP page from a browser on another machine - error will be displayed in resulting page

Suggested fix:
allow ODBC connections to use DSN connection strings again
[30 Jun 2008 5:01] Bogdan Degtyariov
Which version of MySQL Connector/ODBC 5.1.x you are currently using?
[30 Jun 2008 5:07] shaun neal
most recent, downloaded it just yesterday

there doesnt seem to be any place to get the version, but the name of the executable i installed is

[8 Jul 2008 8:21] Bogdan Degtyariov
Thanks for the info. I will try to verify the bug using MyODBC 5.1.4.
FYI: you can check the version of any DLL in the properties window.
For instance: right mouse click on "C:\Program Files\MySQL\Connector ODBC 5.1\myodbc5.dll" (this is the default location of the driver binary). In the displayed dialog select the "version" tab.
[8 Jul 2008 10:04] Bogdan Degtyariov
Unfortunately, I cannot repeat the bug, but it can be related to another bug that has been recently fixed (http://bugs.mysql.com/bug.php?id=36203).

Please try to download a snapshot build of MyODBC 5.1.5 with the patch from here:

This build is non-install one, so you would need to unzip myodbc5.dll/myodbc5S.dll files in C:\Program Files\MySQL\Connector ODBC 5.1\

[21 Jul 2008 23:20] shaun neal
I reworked the application so that the reconnect was not needed.  I cannot confirm or deny if this issue ws closed.
[21 Jul 2008 23:22] shaun neal
ignore last post...i downgraded server and the problem went away
[22 Jul 2008 8:24] Tonci Grgin
Shaun, I am missing few pieces of info here...
  o) Did you replace entire MySQL server version(s) or just copied binaries over? It is important for me to know if grant tables were in accordance with MySQL server version as ODBC@ is default windows user.
  o) What was the type of DSN? File, system, user...

It could very well be that (and I'm highly speculating now) you were truly affected by problem Bogdan mentioned (although it presents when one has many many DSN's defined and for System/User DSN's mostly) and you copied grant tables from older version of MySQL server to newer one. Is this the case?
[22 Aug 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[30 May 2013 6:36] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.