[unixODBC-support] Error using isql - database not bound to DSN?

Nick Gorham nick at lurcher.org
Wed Aug 29 21:30:42 BST 2012


On 29/08/2012 21:02, Gallagher James wrote:
> Hi,
>
> I'm using unixODBC 2.3.1 to talk to a MySQL database on OS/X 10.7 using the ODBC driver from MySQL.
>
> I can connect to the mysql server and issue commands (SHOW DATABASES; USE <database>, …) but based on my configuration I think that a particular database should be USEd when I start up isql. Here's how I'm starting isql:
>
> isql myodbc5 jimg
>
> And here are my odbc.ini and odbcinst.ini files:
>
> odbc.ini:
> [ODBC Data Sources]
> data_source_name = myodbc5
>
> [myodbc5]
> Driver          = MyODBC
> DATABASE        = test
> DESCRIPTION     = MySQL ODBC
> SERVER          = localhost
> UID             = jimg
> PASSWORD        =
> # SOCKET          = /tmp/connector-odbc-5.1-64bit/tmp/mysqld.1.sock
>
> odbcinst.ini:
> [ODBC Drivers]
> MyODBC = Installed
> # /usr/local/lib/libmyodbc5.so = Installed
>
> [MyODBC]
> Driver = /usr/local/lib/libmyodbc5.so
> Description = Driver for connecting to MySQL database server
> Threading = 0
>
> Based on this, I think that the database 'test' should be in use once the connection with unixODBC is made. Is that correct? Or is there something I'm missing from this configuration that would enable that behavior?

I would expect it would, but it depends on a few Driver related things. 
Does the driver use the Database keyword?, does the driver use unixODBC 
to read the ini file, if not is it reading the same ini file?

I can't answer those question, they are driver related so the MySQL folk 
should be able to give the answer you need.

-- 
Nick


More information about the unixODBC-support mailing list