Search code examples
sql-serverlinuxodbcisql

isql without sudo (MSSQL ODBC Linux)


I successfully installed the offical MSSQL ODBC drivers in Linux and I can connect to every database and execute commands with isql:

sudo isql -v dsn user pw

However, if I execute a SQL statement (select ...) in my own application it is not possible to fetch data ("Driver does not support this function") -> I think it is because isql needs sudo rights.

Is there any way to execute isql without sudo? I tried to change (chmod, chown) some rights for isql, but I still need sudo.


Solution

  • I found the solution. The problem was not isql, but the location of odbc.ini and odbcinst.ini!

    As "sudo" the connection is looking at /etc/odbc.ini and /etc/odbcinst.ini

    As "normal" user the connection is looking at a path like that: /usr/local/odbc.ini and /usr/local/odbcinst.ini

    I edited both files and the connection worked!