Re: Trouble connecting with PostgreSQL driver

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

Re: Trouble connecting with PostgreSQL driver

Julie Reier
Here’s the trace:

[ODBC][5269][1421159168.178251][__handles.c][460]
Exit:[SQL_SUCCESS]
Environment = 0x133e750
[ODBC][5269][1421159168.178334][SQLAllocHandle.c][375]
Entry:
Handle Type = 2
Input Handle = 0x133e750
[ODBC][5269][1421159168.178388][SQLAllocHandle.c][493]
Exit:[SQL_SUCCESS]
Output Handle = 0x133f050
[ODBC][5269][1421159168.178441][SQLConnect.c][3727]
Entry:
Connection = 0x133f050
Server Name = [rndredshift.gio.videologygroup.com][length = 34
(SQL_NTS)]
User Name = [readonly][length = 8 (SQL_NTS)]
Authentication = [**********][length = 10 (SQL_NTS)]
[ODBC][5269][1421159168.178484][SQLConnect.c][3780]Error: HY090
[ODBC][5269][1421159168.178554][SQLError.c][434]
Entry:
Connection = 0x133f050
SQLState = 0x7fffb79fcc60
Native = 0x7fffb79fcc78
Message Text = 0x7fffb79fca60
Buffer Length = 500
Text Len Ptr = 0x7fffb79fcc7e
[ODBC][5269][1421159168.178667][SQLError.c][471]
Exit:[SQL_SUCCESS]
SQLState = S1090
Native = 0x7fffb79fcc78 -> 0
Message Text = [[unixODBC][Driver Manager]Invalid string or buffer
length]
[ODBC][5269][1421159168.178742][SQLError.c][434]
Entry:
Connection = 0x133f050
SQLState = 0x7fffb79fcc60
Native = 0x7fffb79fcc78
Message Text = 0x7fffb79fca60
Buffer Length = 500
Text Len Ptr = 0x7fffb79fcc7e
[ODBC][5269][1421159168.178789][SQLError.c][471]
Exit:[SQL_NO_DATA]
[ODBC][5269][1421159168.178835][SQLError.c][514]
Entry:
Environment = 0x133e750
SQLState = 0x7fffb79fcc60
Native = 0x7fffb79fcc78
Message Text = 0x7fffb79fca60
Buffer Length = 500
Text Len Ptr = 0x7fffb79fcc7e
[ODBC][5269][1421159168.178881][SQLError.c][551]
Exit:[SQL_NO_DATA]
[ODBC][5269][1421159168.178943][SQLFreeHandle.c][284]
Entry:
Handle Type = 2
Input Handle = 0x133f050
[ODBC][5269][1421159168.178998][SQLFreeHandle.c][333]
Exit:[SQL_SUCCESS]
[ODBC][5269][1421159168.179045][SQLFreeHandle.c][219]
Entry:
Handle Type = 1
Input Handle = 0x133e750






On 1/13/15, 12:00 PM, "[hidden email]"
<[hidden email]> wrote:

>Re: [unixODBC-support] Trouble connecting with PostgreSQL
>driver
This email is intended only for the use of the individual(s) to whom it is addressed. If you have received this communication in error, please immediately notify the sender and delete the original email.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble connecting with PostgreSQL driver

Nick Gorham-2
On 13/01/15 14:30, Julie Reier wrote:
> Here’s the trace:

Ok, That looks like it being cause by the line

if ( len > SQL_MAX_DSN_LENGTH )


Where len is 34 in this case, and SQL_MAX_DSN_LENGTH is 32

We inherited the 32 from Microsoft.

--
Nick


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

Re: Trouble connecting with PostgreSQL driver

Julie Reier
In reply to this post by Julie Reier
Thanks!!

I changed the odbc.ini file to use a shorter name, and now I’m getting a
different error.

$ odbcinst -q -s
[RPTDB.tidaltv.com]
[OPTDB.tidaltv.com]
[rndredshift.gio.videologygroup.com]
[rndredshift]

$ isql -v rndredshift readonly ********
[01000][unixODBC][Driver Manager]Can't open lib
'/usr/lib64/libodbcpsql.so' : file not found
[ISQL]ERROR: Could not SQLConnect



But it looks like the file exists and is a link to libodbcpsql.so.2.0.0 :
$ ls -al /usr/lib64/libodbcpsql*
-rwxr-xr-x 1 root root     753 Jan  9 18:39 /usr/lib64/libodbcpsql.la
-rwxr-xr-x 1 root root     736 Jan  9 18:39 /usr/lib64/libodbcpsqlS.la
lrwxrwxrwx 1 root root      20 Jan 12 20:10 /usr/lib64/libodbcpsql.so ->
libodbcpsql.so.2.0.0
lrwxrwxrwx 1 root root      20 Jan 12 18:18 /usr/lib64/libodbcpsql.so.1 ->
libodbcpsql.so.1.0.0
-rwxr-xr-x 1 root root 1517993 Jan  9 18:39 /usr/lib64/libodbcpsql.so.1.0.0
lrwxrwxrwx 1 root root      20 Jan  9 18:41 /usr/lib64/libodbcpsql.so.2 ->
libodbcpsql.so.2.0.0
-rwxr-xr-x 1 root root 1539570 Jan  9 18:39 /usr/lib64/libodbcpsql.so.2.0.0
-rwxr-xr-x 1 root root 1539570 Jan  9 18:39 /usr/lib64/libodbcpsql.so.2.BAK
-rwxr-xr-x 1 root root 1539570 Jan  9 18:39 /usr/lib64/libodbcpsql.so.BAK
lrwxrwxrwx 1 root root      21 Jan 12 18:00 /usr/lib64/libodbcpsqlS.so ->
libodbcpsqlS.so.2.0.0
lrwxrwxrwx 1 root root      21 Jan 12 18:18 /usr/lib64/libodbcpsqlS.so.1
-> libodbcpsqlS.so.1.0.0
-rwxr-xr-x 1 root root   31722 Jan  9 18:39
/usr/lib64/libodbcpsqlS.so.1.0.0
lrwxrwxrwx 1 root root      21 Jan 12 18:00 /usr/lib64/libodbcpsqlS.so.2
-> libodbcpsqlS.so.2.0.0
-rwxr-xr-x 1 root root    6768 May  6  2014
/usr/lib64/libodbcpsqlS.so.2.0.0


Here’s the trace:
[ODBC][22499][1421260351.056803][__handles.c][460]
Exit:[SQL_SUCCESS]
Environment = 0x8d7750
[ODBC][22499][1421260351.056886][SQLAllocHandle.c][375]
Entry:
Handle Type = 2
Input Handle = 0x8d7750
[ODBC][22499][1421260351.056941][SQLAllocHandle.c][493]
Exit:[SQL_SUCCESS]
Output Handle = 0x8d8050
[ODBC][22499][1421260351.057007][SQLConnect.c][3727]
Entry:
Connection = 0x8d8050
Server Name = [rndredshift][length = 11 (SQL_NTS)]
User Name = [readonly][length = 8 (SQL_NTS)]
Authentication = [**********][length = 10 (SQL_NTS)]
UNICODE Using encoding ASCII 'UTF-8' and UNICODE 'UCS-2LE'


[ODBC][22499][1421260351.059488][SQLConnect.c][1138]Can't open lib
'/usr/lib64/libodbcpsql.so' : file not found
[ODBC][22499][1421260351.059567][SQLError.c][434]
Entry:
Connection = 0x8d8050
SQLState = 0x7fffdae6a570
Native = 0x7fffdae6a588
Message Text = 0x7fffdae6a370
Buffer Length = 500
Text Len Ptr = 0x7fffdae6a58e
[ODBC][22499][1421260351.059634][SQLError.c][471]
Exit:[SQL_SUCCESS]
SQLState = 01000
Native = 0x7fffdae6a588 -> 0
Message Text = [[unixODBC][Driver Manager]Can't open lib
'/usr/lib64/libodbcpsql.so' : file not found]
[ODBC][22499][1421260351.059706][SQLError.c][434]
Entry:
Connection = 0x8d8050
SQLState = 0x7fffdae6a570
Native = 0x7fffdae6a588
Message Text = 0x7fffdae6a370
Buffer Length = 500
Text Len Ptr = 0x7fffdae6a58e
[ODBC][22499][1421260351.059753][SQLError.c][471]
Exit:[SQL_NO_DATA]
[ODBC][22499][1421260351.059800][SQLError.c][514]
Entry:
Environment = 0x8d7750
SQLState = 0x7fffdae6a570
Native = 0x7fffdae6a588
Message Text = 0x7fffdae6a370
Buffer Length = 500
Text Len Ptr = 0x7fffdae6a58e
[ODBC][22499][1421260351.059844][SQLError.c][551]
Exit:[SQL_NO_DATA]
[ODBC][22499][1421260351.059908][SQLFreeHandle.c][284]
Entry:
Handle Type = 2
Input Handle = 0x8d8050
[ODBC][22499][1421260351.059960][SQLFreeHandle.c][333]
Exit:[SQL_SUCCESS]
[ODBC][22499][1421260351.060019][SQLFreeHandle.c][219]
Entry:
Handle Type = 1
Input Handle = 0x8d7750


On 1/14/15, 12:00 PM, "[hidden email]"
<[hidden email]> wrote:

>Re: Trouble connecting with PostgreSQL  driver
This email is intended only for the use of the individual(s) to whom it is addressed. If you have received this communication in error, please immediately notify the sender and delete the original email.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble connecting with PostgreSQL driver

Nick Gorham-2
On 14/01/15 18:33, Julie Reier wrote:

> Thanks!!
>
> I changed the odbc.ini file to use a shorter name, and now I’m getting a
> different error.
>
> $ odbcinst -q -s
> [RPTDB.tidaltv.com]
> [OPTDB.tidaltv.com]
> [rndredshift.gio.videologygroup.com]
> [rndredshift]
>
> $ isql -v rndredshift readonly ********
> [01000][unixODBC][Driver Manager]Can't open lib
> '/usr/lib64/libodbcpsql.so' : file not found
> [ISQL]ERROR: Could not SQLConnect

Try

ldd /usr/lib64/libodbcpsql.so

To make sure all the dependences are found.

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

Re: Trouble connecting with PostgreSQL driver

Julie Reier
$ ldd /usr/lib64/libodbcpsql.so
linux-gate.so.1 =>  (0x0035b000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00c28000)
libdl.so.2 => /lib/libdl.so.2 (0x00759000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00a7f000)
libm.so.6 => /lib/libm.so.6 (0x00e61000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00eff000)
libc.so.6 => /lib/libc.so.6 (0x003b7000)
/lib/ld-linux.so.2 (0x00101000)
libfreebl3.so => /lib/libfreebl3.so (0x00cdd000)





On 1/14/15, 7:48 PM, "Nick Gorham" <[hidden email]> wrote:

>On 14/01/15 18:33, Julie Reier wrote:
>> Thanks!!
>>
>> I changed the odbc.ini file to use a shorter name, and now I’m getting a
>> different error.
>>
>> $ odbcinst -q -s
>> [RPTDB.tidaltv.com]
>> [OPTDB.tidaltv.com]
>> [rndredshift.gio.videologygroup.com]
>> [rndredshift]
>>
>> $ isql -v rndredshift readonly ********
>> [01000][unixODBC][Driver Manager]Can't open lib
>> '/usr/lib64/libodbcpsql.so' : file not found
>> [ISQL]ERROR: Could not SQLConnect
>
>Try
>
>ldd /usr/lib64/libodbcpsql.so
>
>To make sure all the dependences are found.
>
>--
>Nick
>_______________________________________________
>unixODBC-support mailing list
>[hidden email]
>http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
This email is intended only for the use of the individual(s) to whom it is addressed. If you have received this communication in error, please immediately notify the sender and delete the original email.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble connecting with PostgreSQL driver

Nick Gorham-2
On 14/01/15 20:04, Julie Reier wrote:

> $ ldd /usr/lib64/libodbcpsql.so
> linux-gate.so.1 =>  (0x0035b000)
> libnsl.so.1 => /lib/libnsl.so.1 (0x00c28000)
> libdl.so.2 => /lib/libdl.so.2 (0x00759000)
> libcrypt.so.1 => /lib/libcrypt.so.1 (0x00a7f000)
> libm.so.6 => /lib/libm.so.6 (0x00e61000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x00eff000)
> libc.so.6 => /lib/libc.so.6 (0x003b7000)
> /lib/ld-linux.so.2 (0x00101000)
> libfreebl3.so => /lib/libfreebl3.so (0x00cdd000)

That all looks fine.

Given the driver is not using libodbc.so to read the ini file, try setting

export ODBCINI=/usr/local/unixODBC/etc/odbc.ini

so the driver can find the ini file.

Failing that try using

     strace -o st.log isql -v rndredshift readonly ********

To see if it shows any failed attempt to read a lib or other file.

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

Re: Trouble connecting with PostgreSQL driver

Julie Reier
The output of strace doesn’t tell me anything, and it’s too big to include
here.
Is there anything in particular I should look for in the trace?




On 1/14/15, 9:30 PM, "Nick Gorham" <[hidden email]> wrote:

>On 14/01/15 20:04, Julie Reier wrote:
>> $ ldd /usr/lib64/libodbcpsql.so
>> linux-gate.so.1 =>  (0x0035b000)
>> libnsl.so.1 => /lib/libnsl.so.1 (0x00c28000)
>> libdl.so.2 => /lib/libdl.so.2 (0x00759000)
>> libcrypt.so.1 => /lib/libcrypt.so.1 (0x00a7f000)
>> libm.so.6 => /lib/libm.so.6 (0x00e61000)
>> libpthread.so.0 => /lib/libpthread.so.0 (0x00eff000)
>> libc.so.6 => /lib/libc.so.6 (0x003b7000)
>> /lib/ld-linux.so.2 (0x00101000)
>> libfreebl3.so => /lib/libfreebl3.so (0x00cdd000)
>
>That all looks fine.
>
>Given the driver is not using libodbc.so to read the ini file, try setting
>
>export ODBCINI=/usr/local/unixODBC/etc/odbc.ini
>
>so the driver can find the ini file.
>
>Failing that try using
>
>     strace -o st.log isql -v rndredshift readonly ********
>
>To see if it shows any failed attempt to read a lib or other file.
>
>--
>Nick
>_______________________________________________
>unixODBC-support mailing list
>[hidden email]
>http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
This email is intended only for the use of the individual(s) to whom it is addressed. If you have received this communication in error, please immediately notify the sender and delete the original email.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble connecting with PostgreSQL driver

Nick Gorham-2
On 20/01/15 17:38, Julie Reier wrote:
> The output of strace doesn’t tell me anything, and it’s too big to include
> here.
> Is there anything in particular I should look for in the trace?

Look to see if it opens the libs you expect, look at what ini files it
opens, look if it opens a socket connection to the server.

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

configuring to use alternate unixODBC driver

Harold Pritchett
In reply to this post by Julie Reier
I am working on troubleshooting a problem with a php program accessing a db2 database under CENTOS 6.

I am using the default versions of everything, at the current level.  A program which I know works on a system with much down level versions of almost everything instead is failing
with a segmentation fault.  The purpose of this project is to get the production system to current software levels.

As a first step, I downloaded the current version  (unixODBC-2.3.2) of the unixODBC driver and built it.

Now, I can't find where to tell my system to load this driver instead of the default one from /usr/lib or /usr/lib64

my drivers are here:

# find / -name libodbc.so -print
/home/harold/unixODBC-2.3.2/DriverManager/.libs/libodbc.so
/usr/local/unixODBC64/lib/libodbc.so
/usr/lib/libodbc.so
/usr/lib64/libodbc.so

Thanks for any assistance.

Harold

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

Re: Trouble connecting with PostgreSQL driver

Julie Reier
In reply to this post by Nick Gorham-2
I didn’t see anything obvious in the trace.
I decided to simplify things by creating a VM for testing.
I installed the bare minimum, and now I’m seeing a different error:

DIAG [08001] Could not connect to the server;
Could not connect to remote socket immedaitely

I am able to connect using psql.

Again, any help with this is much appreciated.

~julie



On 1/20/15, 5:40 PM, "Nick Gorham" <[hidden email]> wrote:

>On 20/01/15 17:38, Julie Reier wrote:
>> The output of strace doesn’t tell me anything, and it’s too big to
>>include
>> here.
>> Is there anything in particular I should look for in the trace?
>
>Look to see if it opens the libs you expect, look at what ini files it
>opens, look if it opens a socket connection to the server.
>
>--
>Nick
>_______________________________________________
>unixODBC-support mailing list
>[hidden email]
>http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
This email is intended only for the use of the individual(s) to whom it is addressed. If you have received this communication in error, please immediately notify the sender and delete the original email.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: configuring to use alternate unixODBC driver

Mike
In reply to this post by Harold Pritchett

Harold,

Any chance that your HOME or OBDCSYSINI paths are really long?

It seems you compiled this yourself.

If you just used the default 'make install' without any parameters,  
normally it would go to /usr/local.

If you didn't compile this yourself, use your package manager to tell  
you where the files will end up.

Look here for a suggestion:  
http://www.cyberciti.biz/faq/rhel-centos-fedora-list-contents-of-package-using-yum-command/

I might be missing something though, so any more info you have that  
you think could help would be great.

Mike B.

Quoting Harold Pritchett <[hidden email]>:

> I am working on troubleshooting a problem with a php program  
> accessing a db2 database under CENTOS 6.
>
> I am using the default versions of everything, at the current level.  
>  A program which I know works on a system with much down level  
> versions of almost everything instead is failing with a segmentation  
> fault.  The purpose of this project is to get the production system  
> to current software levels.
>
> As a first step, I downloaded the current version  (unixODBC-2.3.2)  
> of the unixODBC driver and built it.
>
> Now, I can't find where to tell my system to load this driver  
> instead of the default one from /usr/lib or /usr/lib64
>
> my drivers are here:
>
> # find / -name libodbc.so -print
> /home/harold/unixODBC-2.3.2/DriverManager/.libs/libodbc.so
> /usr/local/unixODBC64/lib/libodbc.so
> /usr/lib/libodbc.so
> /usr/lib64/libodbc.so
>
> Thanks for any assistance.
>
> Harold
>
> _______________________________________________
> unixODBC-support mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support


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

Re: configuring to use alternate unixODBC driver

Harold Pritchett
On 1/22/2015 7:58 PM, Mike wrote:
>
> Harold,
>
> Any chance that your HOME or OBDCSYSINI paths are really long?

No.
>
> It seems you compiled this yourself.
>
> If you just used the default 'make install' without any parameters, normally it would go to /usr/local.

That's where it is.  My problem is I don't know how to tell linux to load it instead of the system version in /usr/lib and /usr/lib64

Thanks

HJarold

>
> If you didn't compile this yourself, use your package manager to tell you where the files will end up.
>
> Look here for a suggestion: http://www.cyberciti.biz/faq/rhel-centos-fedora-list-contents-of-package-using-yum-command/
>
> I might be missing something though, so any more info you have that you think could help would be great.
>
> Mike B.
>
> Quoting Harold Pritchett <[hidden email]>:
>
>> I am working on troubleshooting a problem with a php program accessing a db2 database under CENTOS 6.
>>
>> I am using the default versions of everything, at the current level.  A program which I know works on a system with much down level versions of almost everything instead is
>> failing with a segmentation fault.  The purpose of this project is to get the production system to current software levels.
>>
>> As a first step, I downloaded the current version (unixODBC-2.3.2) of the unixODBC driver and built it.
>>
>> Now, I can't find where to tell my system to load this driver instead of the default one from /usr/lib or /usr/lib64
>>
>> my drivers are here:
>>
>> # find / -name libodbc.so -print
>> /home/harold/unixODBC-2.3.2/DriverManager/.libs/libodbc.so
>> /usr/local/unixODBC64/lib/libodbc.so
>> /usr/lib/libodbc.so
>> /usr/lib64/libodbc.so
>>
>> Thanks for any assistance.
>>
>> Harold
>>
>> _______________________________________________
>> unixODBC-support mailing list
>> [hidden email]
>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>
>
> _______________________________________________
> unixODBC-support mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support

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

Re: configuring to use alternate unixODBC driver

Nick Gorham-2
On 30/01/15 14:24, Harold Pritchett wrote:

> On 1/22/2015 7:58 PM, Mike wrote:
>>
>> Harold,
>>
>> Any chance that your HOME or OBDCSYSINI paths are really long?
>
> No.
>>
>> It seems you compiled this yourself.
>>
>> If you just used the default 'make install' without any parameters,
>> normally it would go to /usr/local.
>
> That's where it is.  My problem is I don't know how to tell linux to
> load it instead of the system version in /usr/lib and /usr/lib64
>
> Thanks

If its library loading you are concerned about, then setting
LD_LIBRARY_PATH to /usr/local/unixODBC64/lib will get it to load the
correct libs.

If you are running 64 bit, then be aware that older versions of the php
odbc interface had problems when it came to sizes of SQLLEN variables. I
think the latest versions are sorted out though.

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

Re: configuring to use alternate unixODBC driver

Michael König
In reply to this post by Harold Pritchett
Hi Harold!

In our company we had a similar issue once. We perform a custom compile
of unixODBC and use this version
instead of the one that comes with the system (SUSE, Ubuntu, or Debian
in our case). We basically change our system environment
when we need to access unixODBC. In our case, we source a custom file

 > source use_unixodbc.sh

in the shell. We put this file in install directory of unixODBC (the one
that contains bin and lib subfolders). Here is what it contains:

--- contents of file use_unixodbc.sh ---
UNIXODBC_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

export UNIXODBC_INCLUDE_DIR=$UNIXODBC_HOME/include
export UNIXODBC_LIB_DIR=$UNIXODBC_HOME/lib

export PATH=$UNIXODBC_HOME/bin:$PATH
export LD_LIBRARY_PATH=$UNIXODBC_LIB_DIR:$LD_LIBRARY_PATH

The first two exports define environment variables for use when
compiling custom ODBC applications, drivers, etc.
The third export basically puts the isql binary before any other isql
binaries found in the system.

The fourth export manipulates the order in which dynamic libraries are
accessed. By putting $UNIXODBC_LIB_DIR before
the current $LD_LIBRARY_PATH, our custom libodbc.so has priority over
other libodbc.so versions in /urs/lib or /usr/lib64.

This should solve your problem. Check the LD_LIBRARY_PATH variable
afterwards to make sure the script works as expected:

 > echo $LD_LIBRARY_PATH

Note that drivers built for unixODBC 2.2.12 and below use 32 bit
integers in some places. You may need to update your dirvers as well.

Hope this helps!

Michael



> That's where it is.  My problem is I don't know how to tell linux to
> load it instead of the system version in /usr/lib and /usr/lib64
>
> Thanks
>
> HJarold
>
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Loading...