[unixODBC-support] FW: RE: trouble with mysql driver on mono

Nick Gorham nick.gorham at easysoft.com
Wed May 12 09:28:24 BST 2010


James Smith wrote:
>
> Good morning,
>
> I’m forwarding this mail again with the full trace as it triggered the 
> 40K limit and hasn’t be moderated yet. I’ve removed the complete trace 
> but the pertinent sections are there.
>
> Many thanks!
>
> Kind regards,
>
> James
>
> * From: * James Smith [mailto:james.smith at aleph-one.com]
> *Sent:* 09 May 2010 19:23
> *To:* ' Support for the unixODBC project '
> *Subject:* RE: [unixODBC-support] trouble with mysql driver on mono
>
> Good evening Nick,
>
> I posted this as an HTML email to make it easier to read, I hope this 
> is okay.
>
> I realised (after reading the documentation on strace, funny that) 
> that I could attach it to an existing process and therefore I was able 
> to get some useful information straight away . It appears to me that 
> after trying to find the odbc.ini file in the web application root 
> directory, mono does indeed manage to locate it in the /etc/ directory:
>
> [pid 3060] 18:06:49.156800 open("/etc/odbc.ini", O_RDONLY) = 9
>
> [pid 3060] 18:06:49.156898 fstat(9, {st_mode=S_IFREG|0644, 
> st_size=465, ...}) = 0
>
> [pid 3060] 18:06:49.157042 mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa1f04f1000
>
> [pid 3060] 18:06:49.157168 read(9, "\n[MySQL]\nDescription = M"..., 
> 4096) = 465
>
> The problem is not with the configuration, therefore, but appears to 
> be that mono cannot open a socket to MySQL:
>
> [pid 3060] 18:06:49.158096 connect(9, {sa_family=AF_FILE, 
> path="/var/run/mysqld/mysqld.sock"}, 110) = 0
>
> [pid 3060] 18:06:49.158292 setsockopt(9, SOL_SOCKET, SO_RCVTIMEO, 
> "\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
>
> [pid 3060] 18:06:49.158554 setsockopt(9, SOL_SOCKET, SO_SNDTIMEO, 
> "\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
>
> [pid 3060] 18:06:49.158989 setsockopt(9, SOL_IP, IP_TOS, [8], 4) = -1 
> EOPNOTSUPP (Operation not supported)
>
> [pid 3060] 18:06:49.159139 setsockopt(9, SOL_SOCKET, SO_KEEPALIVE, 
> [1], 4) = 0
>
> This is my interpretation, anyway. We do know that the connection 
> fails, at least.
>
> Thanks again for your time.
>
> Kind regards,
>
> James
>

 From the man page of connect()

"If the connection or binding succeeds, zero is returned. On error, -1 
is returned, and errno is set appropriately."

So its connecting ok.

I would compare the trace from using your app which fails to connect 
with the one from using isql which does connect. It may be a simple as 
the connection string you are using not supplying the correct attributes 
for the driver.

-- 
Nick


More information about the unixODBC-support mailing list