Install MSSQL Server Locally
In this post we will take a look at how to install MSSQL server for local development using Docker.
- Use Azure Edge Docker container instead of MSSQL server Docker container (for some reason MSSQL server Docker container is not working well)
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=Secret123' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge
- Password should follow the guidelines https://learn.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver16#password-complexity
- Use Azure Data Studio to connect (username is
sa
) - In Prisma use the following env variable with the connection string (because of the self-signed certificate):
DATABASE_URL=sqlserver://127.0.0.1:1433;database=ShopifyConsentManagement;user=sa;password=Secret123;encrypt=DANGER_PLAINTEXT
- Note: Only use
encrypt=DANGER_PLAINTEXT
in local dev. Otherwise useencrypt=true
- Note: Only use