[unixODBC-support] trouble with mysql driver on mono

James Smith james.smith at aleph-one.com
Sun May 9 12:35:35 BST 2010


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



More information about the unixODBC-support mailing list