How to find a SQL server Instance Name on Ubuntu

greenfield70 106 Reputation points
2020-11-10T21:09:45.687+00:00

Hello.
I am using SQL Server express 2019 with SQLCMD installed
My OS is Ubuntu 16.04
After starting the service i try to login and i have the issue with the following error

Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

Last time i entered in SQL server in same Linux OS this way. i Did not have any issue so it was working before.

Just to make sure i c heck if the issue was the password and i changed, but the error is the same. I am likely made an error with the SQL server instance name ((i usually use it on Windows and rarely on Linux but i wanted to use it there too, now) so i wonder if anyone can explain me how to check the right sql server instance name on my ubuntu system, both with Command line on the terminal through command, or either going to open some SQL server conf file. ( did not find the info in mssql conf file, though).

Thanks a lot in advance.
Paolo

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Cris Zhan-MSFT 6,661 Reputation points
    2020-11-11T02:09:29.457+00:00

    Hi @greenfield70 ,

    Usually the 'Server name' can be found in the SQL Server errorlog .
    Or please try to use the IP address to connect to SQL Server, then run the command: select @@SERVERNAME


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Hot issues in October—Users always get connection timeout problem when using multi subnet AG via listener. Especially after failover to another subnet

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. greenfield70 106 Reputation points
    2020-11-10T21:36:52.317+00:00

    Hello
    An Update: I finally found my SQL server instance name but just because i remembered it.
    If anyone knows, however, where this details is stored in Linux (Which conf file) Please let me know./
    Thanks.

    1 person found this answer helpful.
    0 comments No comments

  2. tibor_karaszi@hotmail.com 4,316 Reputation points
    2020-11-11T09:36:02.357+00:00

    What do you mean by "instance name"? The concept of named instance don't exist for the Linux SQL Server, there are only default instance. I.e., the machine name.

    Note that is says "Windows Only" in this article: https://learn.microsoft.com/en-us/sql/sql-server/install/work-with-multiple-versions-and-instances-of-sql-server?view=sql-server-ver15

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.