cancel
Showing results for 
Search instead for 
Did you mean: 

unixODBC and SQLAnywhere in Docker

0 Kudos
2,529

I installed odbc driver in linux and in docker with local server I have no problem but I couldn't connect to remote server in the container

When I run container I get the error.

pyodbc.OperationalError: ('08001', '[08001] [unixODBC] [SAP] [ODBC Driver] [SQL Anywhere] Database server not found (-100) (SQLDriverConnect)')

connect is with sqlalchemy

connectionString = Driver = {/ opt / sqlanywhere17 / lib64 / libdbodbc17.so}: SERVER = server: HOST = 160.112.23.175: PORT = 18000: UID = user11: PWD = user11sql

quoted = quote_plus(connectionString)

new_con = 'sybase+pyodbc:///?odbc_connect={}'.format(quoted)

engine = create__engine(new_con)

I really don't know what to do, I've been going round in circles with this for over a day now. Some help would be greatly appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

I guess you specified HOST and PORT in an inappropriate manner, the syntax for the HOST connection parameter with specified port is

HOST = 160.112.23.175:18000

there is no separate PORT connection parameter.

AFAIK, "PORT=" is only supported when not using the HOST connection parameter but using the LINKS connection parameter which has a PORT protocol option as part of the network options, i.e. "LINKS=TCPIP(HOST=160.112.23.175;PORT=18000)".

VolkerBarth
Contributor
0 Kudos

Hm, I still would recommend to omit the LINKS parameter and just use "HOST= 60.112.23.175:18000" in your original connection string.

FWIW, if the issue is solved, fell free to check the answer as "accepted" via the according check mark 🙂

Answers (0)