[unixODBC-support] trouble with mysql driver on mono
Nick Gorham
nick at lurcher.org
Wed May 5 15:15:13 BST 2010
James Smith wrote:
>
> Good afternoon all,
>
> I posted this earlier to Nick Gorham but thought it best just to post
> to the relevant mailing list after all. Nick, I guess you might prefer
> replying to my enquiry (if you have the time and inclination, that
> is!) in the context of this mailing list so that it gets archived.
> Here goes…
>
>
Hi,
Well, if I failed to respond to it before, it wasn't intentional, I must
have missed it.
>
> I have a website, http://www.jaspermusicstore.com/, with MySQL
> connectivity working on all platforms apart from ASP. This is an
> Ubuntu box, and ASP is served courtesy of mono. Since I can connect to
> MySQL on these other platforms I’m assuming the problem is with my
> ODBC driver. I have unixodbc installed, of course:
>
> root at jms ~: dpkg --get-selections | grep odbc
>
> libmyodbc install
>
> odbcinst1debian1 install
>
> unixodbc install
>
> root at jms ~:
>
> My /etc/odbc.ini file remains empty, but I have added the following
> manually to my /etc/obbcinst.ini file:
>
> [MySQL]
>
> Description = MySQL ODBC 3.51 Driver
>
> Driver = /usr/lib/odbc/libmyodbc.so
>
> Setup = /usr/lib/odbc/libodbcmyS.so
>
> CPTimeout =
>
> CPReuse =
>
>
Ok, it may be worth creating a DSN entry in /etc/odbc.ini to make sure
that MyODBC can connect.
>
> The libraries referenced here are indeed present. I’ve double checked
> this.
>
> I use the driver from within my ASP web application with the following
> call:
>
> OdbcConnection handle = new OdbcConnection( "DRIVER={MySQL ODBC 3.51
> Driver};" +
>
> "SERVER=" + host + ";" +
>
> "DATABASE=" + database + ";" +
>
> "UID=" + username + ";" +
>
> "PASSWORD=" + password + ";" +
>
> "OPTION=3" );
>
> handle . * Open * ();
>
> The open() method throws an exception with error code 80004005, which
> seems singularly unhelpful!
>
My only suggestion is to try and see whats going on at the ODBC level.
In your odbcinst.ini file add the following
[ODBC]
Trace=Yes
TraceFile = /tmp/sql.log
Then try connecting, and see what you get in the /tmp/sql.log file
--
Nick
More information about the unixODBC-support
mailing list