[unixODBC-support] Help! with setup, please.

Nick Gorham nick.gorham at easysoft.com
Sun Nov 19 13:00:05 GMT 2006


Bob Marcum wrote:

> Yes ... me, too.
>
> Sorry, but I am having trouble setting up any DSN that will allow a 
> connection.
>
> I am using MySQL.  I have had MySQL 4 installed for several months and 
> have used it successfully.  However, I now want to use it with an ODBC 
> setup and am having trouble getting the setup right.  I have the 
> database up and running.  I have established the following '.ini' files:
>
> odbcinst.ini:
> ==============================================
> [PostgreSQL]
> Description        = ODBC for PostgreSQL
> Driver        = /usr/lib/libodbcpsql.so
> Setup        = /usr/lib/libodbcpsqlS.so
> FileUsage        = 1
>
> [MySQL ODBC 3.51 Driver]
> Description    = MySQL driver
> Driver        = /usr/lib/libmyodbc3.so
> Driver64    = Setup        = /usr/lib/libmyodbc3S.so
> Setup64        = UsageCount    = 1
> CPTimeout    = CPReuse        =
> odbc.ini
> ==============================================
> ;
> ;  odbc.ini configuration for Connector/ODBC and Connector/ODBC 3.51 
> drivers
> ;
>
> [ODBC Data Sources]
> myodbc      = MyODBC 2.50 Driver DSN
> myodbc3     = MyODBC 3.51 Driver DSN
>
> [myodbc]
> Driver       = /usr/lib/libmyodbc.so
> Description  = MyODBC 2.50 Driver DSN
> SERVER       = localhost
> PORT         =
> USER         = root
> Password     =
> Database     = test
> OPTION       = 3
> SOCKET       =
>
> [myodbc3]
> Driver       = /usr/lib/libmyodbc3.so
> Description  = Connector/ODBC 3.51 Driver DSN
> SERVER       = localhost
> PORT         =
> USER         = Password     = Database     = OPTION       =
> SOCKET       =
>
> [Default]
> Driver       = /usr/lib/libmyodbc3.so
> Description  = Connector/ODBC 3.51 Driver DSN
> SERVER       = localhost
> PORT         =
> USER         = Password     = Database     = OPTION       = 4
> SOCKET       =
> TraceFile    = /root/unixODBCTrace
> Trace         = 1
>
>
> Even though I have odbc.ini set to generate a trace file, I get no 
> trace file in /root.  I have tried to connect using isql (and I have 
> used ODBCConfig, and odbctest and [anything else I thought might work 
> or give me useful information])
>
> When I try to connect via isql I enter the following command and get 
> this error report:
>
> # isql Default a_valid_username a_valid_password
> [ISQL]ERROR: Could not SQLConnect
>
> Guidance, please?
>
> Thank you for your help.
>
>
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>
>
Ok, first thing, you have a iODBC format set of ini files, they sould 
work with unixODBC, but what I would have done is loose the

[ODBC Data Sources]
myodbc      = MyODBC 2.50 Driver DSN
myodbc3     = MyODBC 3.51 Driver DSN


entry in odbc.ini,

in odbcinst.ini add a

[ODBC]
Tracing = Yes
TraceFile = /tmp/sql.log

That will turn on unixODBC DM tracing.

Then in your odbc.ini entry, reference the odbcinst.ini entry, not 
directly to the driver, so have

[Default]
Driver       =  MySQL ODBC 3.51 Driver
Description  = Connector/ODBC 3.51 Driver DSN
SERVER       = localhost
PORT         =
USER         = Password     = Database     = OPTION       = 4
SOCKET       =

Finally if you add -v to isql it will show you any returned errors.

isql -v dsn user password

-- 
Nick



More information about the unixODBC-support mailing list