![]() $sqlConn.ConnectionString = "Server='127.0.0.1,51433' Integrated Security=false Initial Catalog=master User ID=sa Password='SecurePassword1!'"Īs was said in a previous answer, maybe check if you have a firewall blocking connections. ![]() $sqlConn.ConnectionString = "Server=localhost,51433 Integrated Security=false Initial Catalog=master User ID=sa Password='SecurePassword1!'"Īnd with 127.0.0.1, again you can see the connection working with PowerShell. $guid = New-Guidĭocker pull /mssql/server:2019-latestĭocker run -p 51433:1433 -e "MSSQL_SA_PASSWORD=SecurePassword1!" -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" -label source="$containerName" -d -name "$containerName-$guid" -v sql2017volume:/var/opt/mssql /mssql/server:2017-latestĪs you can see, I am able to connect (using SSMS) to both endpoints on the specified port.Īdditionally, I was able to connect using the below code through PowerShell. I've done a similar thing to you and am able to get this working for both localhost and 127.0.0.1. Is there anything I need to specify in docker-compose to make this work? When checking documentation, there are no params aligned to it as I see. There is MySQL and different other servers already spun up which I can access with localhost. I tried your setup locally with phpmyadmin running in a container and it worked for me. My docker engine is running in wsl, an ubuntu distro specifically. I could able to connect with 'localhost' to db with udl file also: The same happens when I tried to connect with SQL server management studio. That is, it fails when trying to connect with 'localhost' as host, it is successfully connecting when "127.0.0.1" is specified as host. I would like to create another mariadb+phpmyadmin container, but I'm getting error: Warning Access denied for user 'root''127.0.0.1' (using password: YES). Remote computer refused the network connection.)" I have working mariadb+phpmyadmin container on my local dev computer. Is correct and that SQL Server is configured to allow remote connections. ![]() The server was not found or was not accessible. It throws error like: "A network-related or instance-specific error occurred whileĮstablishing a connection to SQL Server. $connection = New-Object ($connectionString) The server is up and running successfully, But when tried to connect with PowerShell script code: $connectionString = "Data Source=localhost,1433 User ID=sa Password=Dev1234! " Trying to spin up an mssql server with a docker-compose file: version: "3.7" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |