SQL2019 ODBC Connection from Linux setup help.

  • I can connect to the sql server 2019  from my linux machine with tsql but not with isql or with PHP odbc_connect. I can connect to older SQL Servers. I have tried a lot of different thing including FreeTDS. isql error is [ISQL]ERROR: Could not SQLConnect

    my odbcinst.ini

    [FreeTDS]

    Description=FreeTDS Driver

    Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so

    Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so

    [ODBC Driver 18 for SQL Server]

    Description=Microsoft ODBC Driver 18 for SQL Server

    Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.3.so.2.1

    UsageCount=1

    [ODBC Driver 17 for SQL Server]

    Description=Microsoft ODBC Driver 17 for SQL Server

    Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.5.1

    UsageCount=1

    My odbc.ini

    [KF-M1]

    Driver=FreeTDS

    Trace=Yes

    Servername=KF-M1

    Database=M1_KF

     

     

     

  • Is that the only error? USUALLY an "unable to connect" is followed by some information about a login issue or a cannot find the host or something along those lines.

    BUT if I had to venture an entirely random guess - I would say firewall issue between your linux box and the server KF-M1 OR a DNS issue between the two boxes. I would try using the FQDN (fully qualified domain name) instead of the friendly name for the server and see if that helps? OR possibly check the docs for your odbc.ini file as I find it a little strange that it has a server name but no instance name or port.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • is the client configured to use tls 1.2 with a valid cipher suite? TLS 1.0, 1.1** are turned off by default in 2019+

  • I show

    openssl ciphers -v | awk '{print $2}' | sort | uniq

    SSLv3

    TLSv1

    TLSv1.2

    TLSv1.3

  • If it is server 2022/supports TLS 1.3 server, you can probably dismiss TLS as a problem. TLS 1.3 removes most of the latitude developers had to implement TLS poorly or incorrectly.

    If it is server 2019 check your cipher suite:

    https://learn.microsoft.com/en-us/windows/win32/secauthn/tls-cipher-suites-in-windows-10-v1809

    if your TLS client has a bunch of junk ciphers in it, I would experiment with removing them. It should work if even only a single supported cipher is present but have had problems with a few clients or servers in the past when they supported a bunch of crap ciphers.

  • oh also confirm it is actually using OpenSSL. it could be using a different TLS client

  • Stepping away from TLS being the issue, can you run the isql command with the -v parameter? This will give you verbose output and will tell you EXACTLY what is wrong rather than having to ask on this forum and have us GUESS what to try next?

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  •  

    I deleted the user and created a new one and now it works. I did read some post about user mapping issuse and that may have been the problem.

    Thanks

     

    • This reply was modified 1 year ago by  kat35601.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply