Sometimes we need to access database which is running in container. It’s simple but sometimes we cannot remember. Here, I will show you how to connect SQL Server from docker container using SQL Server Management Studio.
sqldbsaga: image: mcr.microsoft.com/mssql/server:2019-latest
sqldbsaga: environment: - SA_PASSWORD=MyPass@word - ACCEPT_EULA=Y ports: - "5533:1433" volumes: - kyc-saga-sqldb:/var/opt/mssql
Now connect using SSMS
- Run docker compose file
- Run SQL server management studio
- Server name should be - localhos, port name
- Password would be MyPass@word as below image
Then, click Connect.