Score:-2

Error establishing a connection to SQL Server

cn flag

Welcome, After installing MS SQL Server on Ubuntu and trying to connect it shows the following:

~$ sqlcmd -S .\SQLEXPRESS -Q "SELECT GETDATE();" 
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL 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..
Score:0
uy flag

Hi WPPlumber The Error message does clearly shoes the you do not get a connection on tcp level. Best Guess: the hostname .\SQLEXPRESS is not a real hostname and the host running the sqlcmd cannot resolve the name to an IP Adress.

Try SQLEXPRESS or SQLEXPRESS.<domain> or only the IP Adress. Maybe you need another option, a working command looks like

./sqlcmd -S localhost  -U SA -Q "SELECT GETDATE();"

the localhost can be replaced with you real hostname / IP.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.