done for a friend :
- install rpm’s
sudo yum install -y freetds unixODBC unixODBC-devel freetds-libs python3-pyodbc
- create odbc.ini and odbcinst.ini
- for sybase go thereĀ Unix ODBC Sybase
- for oracle go thereĀ Unix ODBC Oracle
- for mssql
- ~/.odbc.ini : the Database definition
[DB01] Driver = FreeTDS Description = DB01 Server = src01 Port = 1433 Database = DB01
- ~/.odbcinst.ini : the driver definition
[FreeTDS] Description = Free Sybase & MS SQL Driver Driver64 = /usr/lib64/libtdsodbc.so.0 Setup64 = /usr/lib64/libtdsS.so.2 Port = 1433
- ~/.odbc.ini : the Database definition
- test with isql
isql -v DB01 myuser mypw
- test with python3
import pyodbc conn = pyodbc.connect('DSN=DB01;UID=myuser;PWD=mypw') cursor = conn.cursor() cursor.execute('select \'hello world\'') print (cursor.fetchone()[0])
hello world
HTH