你如何在linux中允许所有用户访问odbc驱动程序 [英] how do you enable all users access to odbc driver in linux
问题描述
我已经在 linux 中建立了一个连接到 MSSQL 服务器的 odbc 连接:
I have setup an odbc connection in linux that connects to MSSQL server:
这是.ini和inst文件的位置和权限:
This is the location and permission of .ini and inst files:
-rw-r--r-- 1 root root 169 Aug 7 17:00 odbc.ini
-rw-r--r-- 1 root root 188 Aug 7 16:40 odbcinst.ini
这是mssql服务器驱动的权限:
This is the permission to the mssql server driver:
-rwxrwxrwx 1 root root 1855896 Aug 7 16:39 /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2260.0
当我以用户身份登录系统时,我对该文件执行 ls 时,出现权限被拒绝错误,如下所示:
When I am logged in as a user to the system, I do ls on that file, I get permission denied error, as follows:
~> ls -l /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2260.0
ls: cannot access /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2260.0: Permission denied
它对所有用户都具有读、写和执行权限.当我以用户而非 root 身份登录时,我无法从 linux 连接到数据库.当我以 root 身份登录时,我可以与 sql server 建立 ODBC 连接.我在这里做错了什么.我需要大家建立 odbc 连接.
It has read, write, and execute permission for all users. When I am logged in as a user, not root, I cannot connect to the db from linux. When I am logged in as root, I can establish an ODBC connection the sql server. What I am doing wrong here. I need everyone to establish odbc connection.
推荐答案
其他人没有驱动程序目录的权限,这个命令解决了我的问题:
others did not have permission on the drivers directory, this command fixed my issue:
chmod -R o+rx /opt/microsoft/msodbcsql/11.0.2260.0
这篇关于你如何在linux中允许所有用户访问odbc驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!