[unixODBC-support] trouble with mysql driver on mono

Nick Gorham nick at lurcher.org
Sun May 9 16:00:21 BST 2010


James Smith wrote:
> Well, progress of a sort. The following /etc/odbcinst.ini file...
>
> [MySQL]
> Description	= MySQL ODBC 3.51 Driver
> Driver	= /usr/lib/odbc/libmyodbc.so
> Setup		= /usr/lib/odbc/libodbcmyS.so
> CPTimeout	=
> CPReuse	=
>
> [ODBC]
> Trace		= Yes
> TraceFile	= /tmp/sql.odbcinst.log
>
> ...and /etc/odbc.ini file...
>
> [MySQL]
> Description         = MySQL test
> Driver              = MySQL
> Trace               = Yes
> TraceFile           = sql.odbc.log
> Database            = jaspermusicstore-shop
> Servername          = localhost
> UserName            = root
> Password            = ########
> Port                = 5432
> Protocol            = 6.4
> ReadOnly            = No
> RowVersioning       = No
> ShowSystemTables    = No
> ShowOidColumn       = No
> FakeOidIndex        = No
> ConnSettings        =
>
> ...allows me to connect to the database via isql, albeit with a few
> warnings:
>
> root at jms ~: isql MySQL
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (Trace).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (TraceFile).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (Servername).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (UserName).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (Protocol).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (ReadOnly).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (RowVersioning).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute
> (ShowSystemTables).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (ShowOidColumn).
> [MYODBCUtilReadDataSource.c][222][ERROR] Unknown attribute (FakeOidIndex).
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL>
>
> I can use a database from here and execute queries. I guess this means
> there's nothing amiss with the unixODBC setup!
>
> Still no joy from an ASP.NET application, however. The following still
> throws an Exception:
>
> OdbcConnection handle = new OdbcConnection( "DSN=MySQL" );
> 				
> handle.Open();
>
> Any ideas would be greatly appreciated!
>
> Kind regards,
>
> James
>   

I would run the mono app under strace to see what if any ini files are 
being opened, that may show why you get no tracing.

-- 
Nick


More information about the unixODBC-support mailing list