Configure FREETDS and use TSQL to test the connection
Vim/usr/local/freetds/etc/freetds.conf
Add the following content:
[Sybase]
Host = IP Address
Port = port number
TDS Version = 5.0
Client CharSet = UTF-8
Specific IP and port number to be replaced by individual
To test the connection:
/usr/local/freetds/bin/tsql-s sybase-u user name-p password
If the following appears, or something like this, indicates a successful connection, you can execute some SQL statements to try
Locale is "En_us.utf8"
Locale CharSet is "UTF-8"
Using default CharSet "UTF-8"
1>
Configure UNIXODBC and test isql
Create the driver template file 1.txt content as follows:
[TDS]
Description = Sybase
Setup =/usr/lib/libtdss.so
Driver64 =/usr/local/freetds/lib/libtdsodbc.so
Driver =/usr/local/freetds/lib/libtdsodbc.so
SETUP64 =/usr/lib64/libtdss.so
FileUsage = 1
Usagecount = 2
Then use Odbcinst to install the driver:
Odbcinst-i-d-f 1.txt
After the execution, you can check the/etc/odbcinst.ini, if you can see the contents of the TDS, the configuration is not a problem
You can also check the drive with Odbcinst-q-D
Create a template file for the data source with the following contents:
[Xiaosu]
Driver = TDS
Descrption = Sybase Server
Trace = No
Server = IP Address
Database = Databases
Port = port number
The DATABASE,IP address and port number are replaced with the one you need.
Odbcinst-i-s-f 2.txt
After execution, the. odbc.ini file is generated in the user's home directory, and vim ~/.odbc.ini check the file contents. You can also check for available data sources with odbcinst-q-s
Test connection with isql: isql-v xiaosu user name password
If the following appears, the connection is successful.
+---------------------------------------+
| connected! |
| |
| sql-statement |
| Help [TableName] |
| Quit |
| |
+---------------------------------------+
Sql>