Does anyone know a way of testing if an odbc entry on the odbc.ini file is configured correctly?
I would like to know if my linux server is able to connect to my SQL Server using an ODBC entry I configured.
If you are using unixODBC as the ODBC driver manager then just do:
isql -v mydsn myusername mypassword
The most common problem is that the default source build setup is set to /usr/local/etc
, not /etc
, so you (as me) may be look at a nice config file but unused.
To verify it, just run
# odbc_config --odbcinstini
/usr/local/etc/odbcinst.ini
A simple symbolic link solve it.
Another problem can be a missing library, that you can verify by running the ldd
. ex:
# ldd /opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0 | grep "not found"
libodbcinst.so.1 => not found
In this case, I need to put the libodbcinst.so.1 in LD_LIBRARY_PATH
or in any directory in use by /etc/ld.so.conf
.
If you choose to put in ld directories, do not forget to run ldconfig
as root after it to update ldd cache file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With