Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (13.1k points)

I have created a docker container to host SQL server, for that I have used Azure data studio as the GUI for the connection. But, when I restart my computer it doesn't seems to reconnect to the local host. And, I recieved the error message as : 

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

Can anyone help me out to resolved this error??

1 Answer

0 votes
by (26.7k points)

The solution to this error is to re-start the docker container before you are going to connect Azure Data studio.

To start the SQL server on docker, you have to execute this command in a terminal.

sudo docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=YourStrong!Passw0rd' -p 1401:1433 --name sqlserver1 -d microsoft/mssql-server-linux:2017-latest

After that, go to Azure Data studio and connect our database.

I hope this will work.

Want to know more? join Azure Training now!

Browse Categories

...