开发者

how can I make a DSN in linux

开发者 https://www.devze.com 2023-02-05 03:19 出处:网络
In windows computer开发者_运维知识库 I create a DSN for connecting a PI (from OISoft ) database and pull data in excel and others.

In windows computer开发者_运维知识库 I create a DSN for connecting a PI (from OISoft ) database and pull data in excel and others. Now how can I make a DSN in linux or can use the DSN already created in that windows PC.


I think you need to refer to your ODBC library vendor's documentation and/or your ODBC driver vendor's documentation for details.

How these things are handled is very much dependent on how the library does it. You might stick a file somewhere or something.


Linux driver managers (unixODBC and iODBC are the free ones) both use the same configuration files: odbc.ini and odbcinst.ini (or .odbc.ini and .odbcinst.ini in your home directory)

odbc.ini is used to list DSNs:

[ODBC Data Sources]
MyDSN=MyDriver

[MyDSN]
Driver=MyDriver
Description=This is my DSN and its settings for connecting to MyDriver.
UID=TheUsername
PWD=ThePassword
SOMEOTHERSETTING=etc

odbcinst.ini is used to list Drivers:

[ODBC Drivers]
MyDriver=Installed

[MyDriver]
Driver=/path/to/driver.so
Description=This is my driver.

Both of these are analogous to the entries in the Windows registry at HKLM/Software/ODBC/ODBC.INI and HKLM/Software/ODBC/ODBCINST.INI so you can go and copy the values from there to setup your DSN in linux.


DSNs are a windows-only concept. There's no equivalent on Linux.

0

精彩评论

暂无评论...
验证码 换一张
取 消