[unixODBC-support] trouble with mysql driver on mono

James Smith james.smith at aleph-one.com
Fri May 14 18:50:18 BST 2010


Nick, Martin,

 

thanks for the replies.

 

Nick, apologies for not looking at the log files more carefully. I'm glad
it's not a sockets issue at least. I did as you said and increased the
lengths of the log lines, getting some strange results. Notice that I've
changed the username to 'soot' for reasons which will become apparent:

 

---

 

Trying with a DSN but including the username and password in the connecting
string as the Mono documentation advises:

 

OdbcConnection handle = new OdbcConnection(
"DSN=MySQL;UID=soot;PWD=########;" );

 

Access denied for user 's'@'localhost' (using password: YES)

 

So the first letter of the username is picked out only.

 

---

 

Trying with a DSN without the username and password in the connection
string:

 

OdbcConnection handle = new OdbcConnection( "DSN=MySQL" );

 

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

 

It fails. I've changed the username in the 'odbc.ini' file to 'soot' as well
to make the point that it doesn't appear to be being read at all. Something
decides that it's best just to default to 'root'.

 

---

 

Trying without a DSN and using a full connection string:

 

OdbcConnection handle = new OdbcConnection(     "DRIVER={MySQL ODBC 3.51
Driver};" +

                                                "SERVER=localhost;" +

 
"DATABASE=jaspermusicstore-shop;" +

                                                "USERNAME=soot;" +

                                                "PASSWORD=########;" +

                                                "OPTION=3"  );

 

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

 

Predictably, if fails. Again the username is incorrect and no password
appears to be being used.

 

---

 

I've tried swapping USERNAME/PASSWORD for UID/PWD in all the applicable
cases above but to no avail.

 

Sorry, I know this is probably getting very tedious.

 

My impression is that the Mono ODBC implementation is buggy, neither
locating the 'odbc.ini' file nor parsing connecting strings properly and,
given the lack of feedback on the Mono mailing lists, I should try to
connect via something other than ODBC. The fact that iSQL works, not to
mention your kind responses, suggests the problem doesn't lie with unixODBC.

 

Any thoughts, as always, would be greatly appreciated.

 

Kind regards,

 

James

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20100514/b80e2b84/attachment.html>


More information about the unixODBC-support mailing list