Problem connecting to the DSN

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem connecting to the DSN

Igor Korot
Hi, (Nick),

I am trying to see why my program fails to connect.

First some setup:

[code]
igor@IgorDellGentoo ~ $ cat /etc/unixODBC/odbcinst.ini
[ODBC]
Trace=No
TraceFile=/tmp/sql.log
Pooling=No

[myodbc-5.2]
Description=MySQL ODBC 5.2 Driver
Driver=/usr/lib/libmyodbc5a.so
UsageCount=1

[freetds]
Description=Microsoft SQL Server
Driver=libtdsodbc.so
UsageCount=1


igor@IgorDellGentoo ~ $ cat /etc/unixODBC/odbc.ini
[ODBC Data Sources]
myodbc-5.2-test=MySQL ODBC 5.2 Driver Testing DSN
freetds=Microsoft SQL Server

[myodbc-5.2-test]
Description=MySQL ODBC 5.2 Driver Testing DSN
Driver=myodbc-5.2
Socket=/var/run/mysqld/mysqld.sock
Server=localhost
User=root
Database=test
Option=3

[freetds]
Description=Microsoft SQL Server
Driver=freetds
Server=192.168.1.4
Port=1433
Database=draft
[/code]

And this is the gdb log of my program execution. Trying to connect to
mySQL myodnc-5.2-test:

[code]
igor@IgorDellGentoo ~/dbhandler/Debug/dbhandler $ gdb dbhandler
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from dbhandler...done.
(gdb) break database_odbc.cpp:407
No source file named database_odbc.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (database_odbc.cpp:407) pending.
(gdb) run
Starting program: /home/igor/dbhandler/Debug/dbhandler/dbhandler
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, ODBCDatabase::Connect (this=0x7937f0,
selectedDSN=L"myodbc-5.2-test", errorMsg=std::vector of length 0,
capacity 0) at /home/igor/dbhandler/libodbc/database_odbc.cpp:407
407                         ret = SQLDriverConnect( m_hdbc, m_handle,
connectStrIn, SQL_NTS, m_connectString, 1024, &OutConnStrLen, options
);
(gdb) print connectStrIn
$1 = {68, 83, 78, 61, 109, 121, 111, 100, 98, 99, 45, 53, 46, 50, 45,
116, 101, 115, 116, 59, 68, 114, 105, 118, 101, 114, 61, 102, 114,
101, 101, 116, 100, 115, 0 <repeats 476 times>}
(gdb) print (SQLWCHAR *)connectStrIn
$2 = (SQLWCHAR *) 0x7fffffffb5f0
(gdb) n
408                         if( ret != SQL_SUCCESS && ret !=
SQL_SUCCESS_WITH_INFO )
(gdb) print ret
$3 = -1
(gdb)
[/code]

Do you see anything wrong with my .ini files?

Thank you.
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Nick Gorham-2
On 05/06/16 18:27, Igor Korot wrote:
> Do you see anything wrong with my .ini files?

No. I would normally try and connect using isql and see what error that
gives.

--
Nick
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Igor Korot
Nick,

On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
> On 05/06/16 18:27, Igor Korot wrote:
>>
>> Do you see anything wrong with my .ini files?
>
>
> No. I would normally try and connect using isql and see what error that
> gives.

igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
[ISQL]ERROR: Could not SQLConnect

Trying to turn on logging gives:
IgorDellGentoo igor # cat /tmp/sql.log
[ODBC][16276][1465164925.483684][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/__handles.c][460]
                Exit:[SQL_SUCCESS]
                        Environment = 0x1681780
[ODBC][16276][1465164925.483745][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][375]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x1681780
[ODBC][16276][1465164925.483772][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLAllocHandle.c][493]
                Exit:[SQL_SUCCESS]
                        Output Handle = 0x1682080
[ODBC][16276][1465164925.483798][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][3727]
                Entry:
                        Connection = 0x1682080
                        Server Name = [mypdbc-5.2-test][length = 15 (SQL_NTS)]
                        User Name = [root][length = 4 (SQL_NTS)]
                        Authentication = [NULL]
[ODBC][16276][1465164925.484391][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLConnect.c][3935]Error:
IM002
[ODBC][16276][1465164925.484446][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][284]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x1682080
[ODBC][16276][1465164925.484472][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][333]
                Exit:[SQL_SUCCESS]
[ODBC][16276][1465164925.484496][/var/tmp/portage/dev-db/unixODBC-2.3.2-r1/work/unixODBC-2.3.2/DriverManager/SQLFreeHandle.c][219]
                Entry:
                        Handle Type = 1
                        Input Handle = 0x1681780

If I don't provide the password, the driver should ask for it, right?

Thank you.

>
> --
> Nick
> _______________________________________________
> unixODBC-dev mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Nick Gorham-2
On 05/06/16 23:23, Igor Korot wrote:

> Nick,
>
> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>> On 05/06/16 18:27, Igor Korot wrote:
>>> Do you see anything wrong with my .ini files?
>>
>> No. I would normally try and connect using isql and see what error that
>> gives.
> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
> [ISQL]ERROR: Could not SQLConnect

Try

isql -v mypdbc-5.2-test root

> If I don't provide the password, the driver should ask for it, right?
>
> Thank you.

Thats up to the driver.

--
Nick
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Igor Korot
Nick,

On Mon, Jun 6, 2016 at 3:18 AM, Nick Gorham <[hidden email]> wrote:

> On 05/06/16 23:23, Igor Korot wrote:
>>
>> Nick,
>>
>> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>>>
>>> On 05/06/16 18:27, Igor Korot wrote:
>>>>
>>>> Do you see anything wrong with my .ini files?
>>>
>>>
>>> No. I would normally try and connect using isql and see what error that
>>> gives.
>>
>> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
>> [ISQL]ERROR: Could not SQLConnect
>
>
> Try
>
> isql -v mypdbc-5.2-test root

igor@IgorDellGentoo ~/dbhandler $ isql -v mypdbc-5.2-test root
[IM002][unixODBC][Driver Manager]Data source name not found, and no
default driver specified
[ISQL]ERROR: Could not SQLConnect

But it does exist.

Thank you.

>
>> If I don't provide the password, the driver should ask for it, right?
>>
>> Thank you.
>
>
> Thats up to the driver.
>
>
> --
> Nick
> _______________________________________________
> unixODBC-dev mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Nick Gorham-2
On 06/06/16 11:42, Igor Korot wrote:

> Nick,
>
> On Mon, Jun 6, 2016 at 3:18 AM, Nick Gorham <[hidden email]> wrote:
>> On 05/06/16 23:23, Igor Korot wrote:
>>> Nick,
>>>
>>> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>>>> On 05/06/16 18:27, Igor Korot wrote:
>>>>> Do you see anything wrong with my .ini files?
>>>>
>>>> No. I would normally try and connect using isql and see what error that
>>>> gives.
>>> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
>>> [ISQL]ERROR: Could not SQLConnect
>>
>> Try
>>
>> isql -v mypdbc-5.2-test root
> igor@IgorDellGentoo ~/dbhandler $ isql -v mypdbc-5.2-test root
> [IM002][unixODBC][Driver Manager]Data source name not found, and no
> default driver specified
> [ISQL]ERROR: Could not SQLConnect

You get that error if:

1. The DSN doesn't exist
2. The DSN exists, but it points to a driver entry that does not exist
in odbcinst.ini
3. The DSN exists, but the lib entry it contains for Driver= either
doesn't exist, or fails to load

ldd /usr/lib/libmyodbc5a.so

would be my first move.

--
Nick
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Igor Korot
Nick,

On Mon, Jun 6, 2016 at 6:48 AM, Nick Gorham <[hidden email]> wrote:

> On 06/06/16 11:42, Igor Korot wrote:
>>
>> Nick,
>>
>> On Mon, Jun 6, 2016 at 3:18 AM, Nick Gorham <[hidden email]> wrote:
>>>
>>> On 05/06/16 23:23, Igor Korot wrote:
>>>>
>>>> Nick,
>>>>
>>>> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>>>>>
>>>>> On 05/06/16 18:27, Igor Korot wrote:
>>>>>>
>>>>>> Do you see anything wrong with my .ini files?
>>>>>
>>>>>
>>>>> No. I would normally try and connect using isql and see what error that
>>>>> gives.
>>>>
>>>> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
>>>> [ISQL]ERROR: Could not SQLConnect
>>>
>>>
>>> Try
>>>
>>> isql -v mypdbc-5.2-test root
>>
>> igor@IgorDellGentoo ~/dbhandler $ isql -v mypdbc-5.2-test root
>> [IM002][unixODBC][Driver Manager]Data source name not found, and no
>> default driver specified
>> [ISQL]ERROR: Could not SQLConnect
>
>
> You get that error if:
>
> 1. The DSN doesn't exist
> 2. The DSN exists, but it points to a driver entry that does not exist in
> odbcinst.ini
> 3. The DSN exists, but the lib entry it contains for Driver= either doesn't
> exist, or fails to load
>
> ldd /usr/lib/libmyodbc5a.so
>
> would be my first move.

IgorDellGentoo igor # ls -la /usr/lib/libmyo*
-rwxr-xr-x 1 root root 351656 Nov 11  2015 /usr/lib/libmyodbc5a.so
-rwxr-xr-x 1 root root 347560 Nov 11  2015 /usr/lib/libmyodbc5w.so
IgorDellGentoo igor # ldd /usr/lib/libmyodbc5a.so
        linux-vdso.so.1 (0x00007ffccddb5000)
        libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
(0x00007f403436d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4034152000)
        libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2 (0x00007f4033f3f000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f4033d3b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f40339a4000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f403378d000)
        libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007f403351d000)
        libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007f4033137000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f4032e35000)
        /lib64/ld-linux-x86-64.so.2 (0x0000564dc3dc5000)
        libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f4032c2b000)
IgorDellGentoo igor # nano /etc/unixODBC/odbcinst.ini

I changed the driver to be a UNICODE one.

IgorDellGentoo igor # ldd /usr/lib/libmyodbc5w.so
        linux-vdso.so.1 (0x00007fff45302000)
        libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
(0x00007efff998f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007efff9774000)
        libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2 (0x00007efff9561000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007efff935d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007efff8fc6000)
        libz.so.1 => /lib64/libz.so.1 (0x00007efff8daf000)
        libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007efff8b3f000)
        libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007efff8759000)
        libm.so.6 => /lib64/libm.so.6 (0x00007efff8457000)
        /lib64/ld-linux-x86-64.so.2 (0x0000563e5e47d000)
        libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007efff824d000)

IgorDellGentoo igor # ls -la /usr/lib/linux-v*
ls: cannot access /usr/lib/linux-v*: No such file or directory

Any idea what package I'm missing?

Thank you.

>
>
> --
> Nick
> _______________________________________________
> unixODBC-dev mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Nick Gorham-2
On 06/06/16 13:24, Igor Korot wrote:

> Nick,
>
> On Mon, Jun 6, 2016 at 6:48 AM, Nick Gorham <[hidden email]> wrote:
>> On 06/06/16 11:42, Igor Korot wrote:
>>> Nick,
>>>
>>> On Mon, Jun 6, 2016 at 3:18 AM, Nick Gorham <[hidden email]> wrote:
>>>> On 05/06/16 23:23, Igor Korot wrote:
>>>>> Nick,
>>>>>
>>>>> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>>>>>> On 05/06/16 18:27, Igor Korot wrote:
>>>>>>> Do you see anything wrong with my .ini files?
>>>>>>
>>>>>> No. I would normally try and connect using isql and see what error that
>>>>>> gives.
>>>>> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
>>>>> [ISQL]ERROR: Could not SQLConnect
>>>>
>>>> Try
>>>>
>>>> isql -v mypdbc-5.2-test root
>>> igor@IgorDellGentoo ~/dbhandler $ isql -v mypdbc-5.2-test root
>>> [IM002][unixODBC][Driver Manager]Data source name not found, and no
>>> default driver specified
>>> [ISQL]ERROR: Could not SQLConnect
>>
>> You get that error if:
>>
>> 1. The DSN doesn't exist
>> 2. The DSN exists, but it points to a driver entry that does not exist in
>> odbcinst.ini
>> 3. The DSN exists, but the lib entry it contains for Driver= either doesn't
>> exist, or fails to load
>>
>> ldd /usr/lib/libmyodbc5a.so
>>
>> would be my first move.
> IgorDellGentoo igor # ls -la /usr/lib/libmyo*
> -rwxr-xr-x 1 root root 351656 Nov 11  2015 /usr/lib/libmyodbc5a.so
> -rwxr-xr-x 1 root root 347560 Nov 11  2015 /usr/lib/libmyodbc5w.so
> IgorDellGentoo igor # ldd /usr/lib/libmyodbc5a.so
>          linux-vdso.so.1 (0x00007ffccddb5000)
>          libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
> (0x00007f403436d000)
>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4034152000)
>          libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2 (0x00007f4033f3f000)
>          libdl.so.2 => /lib64/libdl.so.2 (0x00007f4033d3b000)
>          libc.so.6 => /lib64/libc.so.6 (0x00007f40339a4000)
>          libz.so.1 => /lib64/libz.so.1 (0x00007f403378d000)
>          libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007f403351d000)
>          libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007f4033137000)
>          libm.so.6 => /lib64/libm.so.6 (0x00007f4032e35000)
>          /lib64/ld-linux-x86-64.so.2 (0x0000564dc3dc5000)
>          libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f4032c2b000)
> IgorDellGentoo igor # nano /etc/unixODBC/odbcinst.ini
>
> I changed the driver to be a UNICODE one.
>
> IgorDellGentoo igor # ldd /usr/lib/libmyodbc5w.so
>          linux-vdso.so.1 (0x00007fff45302000)
>          libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
> (0x00007efff998f000)
>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007efff9774000)
>          libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2 (0x00007efff9561000)
>          libdl.so.2 => /lib64/libdl.so.2 (0x00007efff935d000)
>          libc.so.6 => /lib64/libc.so.6 (0x00007efff8fc6000)
>          libz.so.1 => /lib64/libz.so.1 (0x00007efff8daf000)
>          libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007efff8b3f000)
>          libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007efff8759000)
>          libm.so.6 => /lib64/libm.so.6 (0x00007efff8457000)
>          /lib64/ld-linux-x86-64.so.2 (0x0000563e5e47d000)
>          libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007efff824d000)
>
> IgorDellGentoo igor # ls -la /usr/lib/linux-v*
> ls: cannot access /usr/lib/linux-v*: No such file or directory
>
> Any idea what package I'm missing?
>
> Thank you.

Seems ok. Check they are all 64 bit

file `which isql`
file usr/lib/libmyodbc5w.so

Other than that try strace to see what goes on.

--
Nick
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Igor Korot
Nick,

On Mon, Jun 6, 2016 at 8:35 AM, Nick Gorham <[hidden email]> wrote:

> On 06/06/16 13:24, Igor Korot wrote:
>>
>> Nick,
>>
>> On Mon, Jun 6, 2016 at 6:48 AM, Nick Gorham <[hidden email]> wrote:
>>>
>>> On 06/06/16 11:42, Igor Korot wrote:
>>>>
>>>> Nick,
>>>>
>>>> On Mon, Jun 6, 2016 at 3:18 AM, Nick Gorham <[hidden email]> wrote:
>>>>>
>>>>> On 05/06/16 23:23, Igor Korot wrote:
>>>>>>
>>>>>> Nick,
>>>>>>
>>>>>> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>>>>>>>
>>>>>>> On 05/06/16 18:27, Igor Korot wrote:
>>>>>>>>
>>>>>>>> Do you see anything wrong with my .ini files?
>>>>>>>
>>>>>>>
>>>>>>> No. I would normally try and connect using isql and see what error
>>>>>>> that
>>>>>>> gives.
>>>>>>
>>>>>> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
>>>>>> [ISQL]ERROR: Could not SQLConnect
>>>>>
>>>>>
>>>>> Try
>>>>>
>>>>> isql -v mypdbc-5.2-test root
>>>>
>>>> igor@IgorDellGentoo ~/dbhandler $ isql -v mypdbc-5.2-test root
>>>> [IM002][unixODBC][Driver Manager]Data source name not found, and no
>>>> default driver specified
>>>> [ISQL]ERROR: Could not SQLConnect
>>>
>>>
>>> You get that error if:
>>>
>>> 1. The DSN doesn't exist
>>> 2. The DSN exists, but it points to a driver entry that does not exist in
>>> odbcinst.ini
>>> 3. The DSN exists, but the lib entry it contains for Driver= either
>>> doesn't
>>> exist, or fails to load
>>>
>>> ldd /usr/lib/libmyodbc5a.so
>>>
>>> would be my first move.
>>
>> IgorDellGentoo igor # ls -la /usr/lib/libmyo*
>> -rwxr-xr-x 1 root root 351656 Nov 11  2015 /usr/lib/libmyodbc5a.so
>> -rwxr-xr-x 1 root root 347560 Nov 11  2015 /usr/lib/libmyodbc5w.so
>> IgorDellGentoo igor # ldd /usr/lib/libmyodbc5a.so
>>          linux-vdso.so.1 (0x00007ffccddb5000)
>>          libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
>> (0x00007f403436d000)
>>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4034152000)
>>          libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2
>> (0x00007f4033f3f000)
>>          libdl.so.2 => /lib64/libdl.so.2 (0x00007f4033d3b000)
>>          libc.so.6 => /lib64/libc.so.6 (0x00007f40339a4000)
>>          libz.so.1 => /lib64/libz.so.1 (0x00007f403378d000)
>>          libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0
>> (0x00007f403351d000)
>>          libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
>> (0x00007f4033137000)
>>          libm.so.6 => /lib64/libm.so.6 (0x00007f4032e35000)
>>          /lib64/ld-linux-x86-64.so.2 (0x0000564dc3dc5000)
>>          libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f4032c2b000)
>> IgorDellGentoo igor # nano /etc/unixODBC/odbcinst.ini
>>
>> I changed the driver to be a UNICODE one.
>>
>> IgorDellGentoo igor # ldd /usr/lib/libmyodbc5w.so
>>          linux-vdso.so.1 (0x00007fff45302000)
>>          libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
>> (0x00007efff998f000)
>>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007efff9774000)
>>          libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2
>> (0x00007efff9561000)
>>          libdl.so.2 => /lib64/libdl.so.2 (0x00007efff935d000)
>>          libc.so.6 => /lib64/libc.so.6 (0x00007efff8fc6000)
>>          libz.so.1 => /lib64/libz.so.1 (0x00007efff8daf000)
>>          libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0
>> (0x00007efff8b3f000)
>>          libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
>> (0x00007efff8759000)
>>          libm.so.6 => /lib64/libm.so.6 (0x00007efff8457000)
>>          /lib64/ld-linux-x86-64.so.2 (0x0000563e5e47d000)
>>          libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007efff824d000)
>>
>> IgorDellGentoo igor # ls -la /usr/lib/linux-v*
>> ls: cannot access /usr/lib/linux-v*: No such file or directory
>>
>> Any idea what package I'm missing?
>>
>> Thank you.
>
>
> Seems ok. Check they are all 64 bit

But I'm missing "linux-vds.so.1".
Is it OK?

>
> file `which isql`
> file usr/lib/libmyodbc5w.so
>
> Other than that try strace to see what goes on.

I will check those when I come back home.

Thank you.

>
>
> --
> Nick
> _______________________________________________
> unixODBC-dev mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem connecting to the DSN

Igor Korot
Nick,

On Mon, Jun 6, 2016 at 9:57 AM, Igor Korot <[hidden email]> wrote:

> Nick,
>
> On Mon, Jun 6, 2016 at 8:35 AM, Nick Gorham <[hidden email]> wrote:
>> On 06/06/16 13:24, Igor Korot wrote:
>>>
>>> Nick,
>>>
>>> On Mon, Jun 6, 2016 at 6:48 AM, Nick Gorham <[hidden email]> wrote:
>>>>
>>>> On 06/06/16 11:42, Igor Korot wrote:
>>>>>
>>>>> Nick,
>>>>>
>>>>> On Mon, Jun 6, 2016 at 3:18 AM, Nick Gorham <[hidden email]> wrote:
>>>>>>
>>>>>> On 05/06/16 23:23, Igor Korot wrote:
>>>>>>>
>>>>>>> Nick,
>>>>>>>
>>>>>>> On Sun, Jun 5, 2016 at 2:30 PM, Nick Gorham <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> On 05/06/16 18:27, Igor Korot wrote:
>>>>>>>>>
>>>>>>>>> Do you see anything wrong with my .ini files?
>>>>>>>>
>>>>>>>>
>>>>>>>> No. I would normally try and connect using isql and see what error
>>>>>>>> that
>>>>>>>> gives.
>>>>>>>
>>>>>>> igor@IgorDellGentoo ~/dbhandler $ isql mypdbc-5.2-test root
>>>>>>> [ISQL]ERROR: Could not SQLConnect
>>>>>>
>>>>>>
>>>>>> Try
>>>>>>
>>>>>> isql -v mypdbc-5.2-test root
>>>>>
>>>>> igor@IgorDellGentoo ~/dbhandler $ isql -v mypdbc-5.2-test root
>>>>> [IM002][unixODBC][Driver Manager]Data source name not found, and no
>>>>> default driver specified
>>>>> [ISQL]ERROR: Could not SQLConnect
>>>>
>>>>
>>>> You get that error if:
>>>>
>>>> 1. The DSN doesn't exist
>>>> 2. The DSN exists, but it points to a driver entry that does not exist in
>>>> odbcinst.ini
>>>> 3. The DSN exists, but the lib entry it contains for Driver= either
>>>> doesn't
>>>> exist, or fails to load
>>>>
>>>> ldd /usr/lib/libmyodbc5a.so
>>>>
>>>> would be my first move.
>>>
>>> IgorDellGentoo igor # ls -la /usr/lib/libmyo*
>>> -rwxr-xr-x 1 root root 351656 Nov 11  2015 /usr/lib/libmyodbc5a.so
>>> -rwxr-xr-x 1 root root 347560 Nov 11  2015 /usr/lib/libmyodbc5w.so
>>> IgorDellGentoo igor # ldd /usr/lib/libmyodbc5a.so
>>>          linux-vdso.so.1 (0x00007ffccddb5000)
>>>          libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
>>> (0x00007f403436d000)
>>>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4034152000)
>>>          libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2
>>> (0x00007f4033f3f000)
>>>          libdl.so.2 => /lib64/libdl.so.2 (0x00007f4033d3b000)
>>>          libc.so.6 => /lib64/libc.so.6 (0x00007f40339a4000)
>>>          libz.so.1 => /lib64/libz.so.1 (0x00007f403378d000)
>>>          libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0
>>> (0x00007f403351d000)
>>>          libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
>>> (0x00007f4033137000)
>>>          libm.so.6 => /lib64/libm.so.6 (0x00007f4032e35000)
>>>          /lib64/ld-linux-x86-64.so.2 (0x0000564dc3dc5000)
>>>          libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f4032c2b000)
>>> IgorDellGentoo igor # nano /etc/unixODBC/odbcinst.ini
>>>
>>> I changed the driver to be a UNICODE one.
>>>
>>> IgorDellGentoo igor # ldd /usr/lib/libmyodbc5w.so
>>>          linux-vdso.so.1 (0x00007fff45302000)
>>>          libmysqlclient.so.18 => /usr/lib64/libmysqlclient.so.18
>>> (0x00007efff998f000)
>>>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007efff9774000)
>>>          libodbcinst.so.2 => /usr/lib64/libodbcinst.so.2
>>> (0x00007efff9561000)
>>>          libdl.so.2 => /lib64/libdl.so.2 (0x00007efff935d000)
>>>          libc.so.6 => /lib64/libc.so.6 (0x00007efff8fc6000)
>>>          libz.so.1 => /lib64/libz.so.1 (0x00007efff8daf000)
>>>          libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0
>>> (0x00007efff8b3f000)
>>>          libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
>>> (0x00007efff8759000)
>>>          libm.so.6 => /lib64/libm.so.6 (0x00007efff8457000)
>>>          /lib64/ld-linux-x86-64.so.2 (0x0000563e5e47d000)
>>>          libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007efff824d000)
>>>
>>> IgorDellGentoo igor # ls -la /usr/lib/linux-v*
>>> ls: cannot access /usr/lib/linux-v*: No such file or directory
>>>
>>> Any idea what package I'm missing?
>>>
>>> Thank you.
>>
>>
>> Seems ok. Check they are all 64 bit
>
> But I'm missing "linux-vds.so.1".
> Is it OK?
>
>>
>> file `which isql`
>> file usr/lib/libmyodbc5w.so
>>
>> Other than that try strace to see what goes on.
>
> I will check those when I come back home.

Everything works!!!
I reviewed my connect statement and found a typo in the DSN.

Then I got a different error message - found that I have to be in the
mysql group to connect.

So now connection works.

And so now I need to find what parameter I need to pass in order for
the driver to ask for the password
as storing the password in the odbc.ini (plain text) is not secure.

Thank you and sorry for the confusion.

>
> Thank you.
>
>>
>>
>> --
>> Nick
>> _______________________________________________
>> unixODBC-dev mailing list
>> [hidden email]
>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
_______________________________________________
unixODBC-dev mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
Loading...