I am trying to connect MS SQL 2016 sp2 from Red Hat 8. I tried both ms odbc and freetds but both do not work.
tsql -S server_name -p 1433 -D db_name -U user_name -P pwd
Error:
log.c:187:Starting log file for FreeTDS 1.3.13
on 2023-03-29 16:26:07 with debug flags 0x4fff.
dblib.c:1187:tdsdbopen(0x55590bb585b0, servername.domain.int:1433, [microsoft])
dblib.c:1213:tdsdbopen: dbproc->dbopts = 0x55590bc57890
dblib.c:1224:tdsdbopen: tds_set_server(0x55590bc256d0, "servername.domain.int:1433")
dblib.c:251:dblib_get_tds_ctx(void)
dblib.c:1241:tdsdbopen: About to call tds_read_config_info...
config.c:170:Getting connection information for [servername.domain.int:1433].
config.c:174:Attempting to read conf files.
config.c:362:... $FREETDSCONF not set. Trying $FREETDS/etc.
config.c:375:... $FREETDS not set. Trying $HOME.
config.c:301:Could not open '/home/orch_dev/.freetds.conf' ((.freetds.conf)).
config.c:301:Could not open '/usr/local/etc/freetds.conf' ((default)).
config.c:362:... $FREETDSCONF not set. Trying $FREETDS/etc.
config.c:375:... $FREETDS not set. Trying $HOME.
config.c:301:Could not open '/home/orch_dev/.freetds.conf' ((.freetds.conf)).
config.c:301:Could not open '/usr/local/etc/freetds.conf' ((default)).
config.c:833:Setting 'dump_file' to 'stdout' from $TDSDUMP.
config.c:724:tds_config_login: client_charset is UTF-8.
config.c:733:tds_config_login: database_name is CM_SIM.
config.c:833:Setting 'dump_file' to 'stdout' from $TDSDUMP.
dblib.c:1268:tdsdbopen: Calling tds_connect_and_login(0x55590bc44a40, 0x55590bc29310)
iconv.c:367:tds_iconv_open(0x55590bc342e0, UTF-8)
iconv.c:198:local name for ISO-8859-1 is ISO-8859-1
iconv.c:198:local name for UTF-8 is UTF-8
iconv.c:198:local name for UCS-2LE is UCS-2LE
iconv.c:198:local name for UCS-2BE is UCS-2BE
iconv.c:389:setting up conversions for client charset "UTF-8"
iconv.c:391:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion
iconv.c:430:tds_iconv_open: done
net.c:391:Connecting with protocol version 7.4
net.c:318:Connecting to 10.22.222.222 port 1433
net.c:340:tds_setup_socket: connect(2) returned "Operation now in progress"
net.c:528:tds_open_socket() succeeded
packet.c:852:Sending packet
packet.c:361:timeout
util.c:333:tdserror(0x7fff3c1b3070, 0x55590bc44a40, 20003, 115)
util.c:363:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:386:tdserror: returning TDS_INT_CANCEL(2)
query.c:3757:tds_disconnect()
util.c:179:Changed query state from IDLE to DEAD
packet.c:539:Read attempt when state is TDS_DEAD
login.c:599:login packet rejected
util.c:333:tdserror(0x7fff3c1b3070, 0x55590bc44a40, 20002, 0)
util.c:363:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:386:tdserror: returning TDS_INT_CANCEL(2)
net.c:391:Connecting with protocol version 5.0
net.c:318:Connecting to 10.22.222.222 port 1433
net.c:340:tds_setup_socket: connect(2) returned "Operation now in progress"
net.c:528:tds_open_socket() succeeded
token.c:418:tds_process_login_tokens()
packet.c:361:timeout
util.c:333:tdserror(0x7fff3c1b3070, 0x55590bc44a40, 20003, 115)
util.c:363:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:386:tdserror: returning TDS_INT_CANCEL(2)
query.c:3757:tds_disconnect()
mem.c:656:tds_free_all_results()
util.c:179:Changed query state from IDLE to WRITING
util.c:333:tdserror(0x7f8fe33da960, 0x55590bc44a40, 20003, 110)
util.c:369:tdserror: client library not called because either tds_ctx (0x7f8fe33da960) or tds_ctx->err_handler is NULL
util.c:386:tdserror: returning TDS_INT_CANCEL(2)
query.c:3757:tds_disconnect()
isql -v -k 'DRIVER={ODBC Driver 18 for SQL Server};SERVER=server_name,1433;DATABASE=db_name ;UID=user_name;PWD=pwd'
Error:
[S1T00][Microsoft][ODBC Driver 18 for SQL Server]Login timeout expired
[08001][Microsoft][ODBC Driver 18 for SQL Server]TCP Provider: Timeout error [258].
[08001][Microsoft][ODBC Driver 18 for SQL Server]Unable to complete login process due to delay in prelogin response
[ISQL]ERROR: Could not SQLDriverConnect
The strange thing I can succesfully connect that db from Windows 10.
And I can successfuly connect to other MS SQL Server from this linux. The only difference between SQL Servers I found is the one i can connect has self-signed certificate. The one I can't connect - doesn't have certificate.
UPD: Installed certificate to server I can't connect. It did not help.
Any ideas?