How to Set Up SQL Server Database with Docker

preview_player
Показать описание

Docker is a product that allows developers to create containers, which are self-contained areas on their computer for running applications. They can be used for databases, which is great if you can't install it normally (e.g. you use a Mac).

This video shows you how to set up an SQL Server database on Docker. It uses an existing SQL Server 2017 image on the Docker Hub website. You can also use SQL Server 2019 - it's also available on Docker Hub.

You'll learn how to download and install Docker, find the right SQL Server image, download the image, run it, and connect to it in Azure Data Studio. You can use SQL Server Management Studio or any other IDE.

The connection details for this image mentioned in the video are below.

Host: Localhost
Port: 1433
Username: sa
Password: whatever you specify in the "docker run" command

Timestamps:
00:00 In this video
00:08 High-level steps
00:30 Download Docker
01:22 Run Docker
02:05 Create Docker Hub account
02:41 Search for SQL Server image on Docker Hub
03:37 Understand the docker run command
04:25 Open Terminal and login to Docker
05:03 Download image using Docker Run (inc set password and container name)
06:29 Check status using docker ps
06:41 Connect using Azure Data Studio
07:24 Enter connection details
08:00 Run simple query
08:43 Stop the Docker container
Рекомендации по теме
Комментарии
Автор

Got this working on Linux from this guide. Installed docker from package manager, though. Terminal commands are the same and Azure Data Studio works on Linux, too.

Zeadar
Автор

Super crisp and well explained with the demo! Thank you so much for making this easy to understand!

VipulDK
Автор

If you are on windows and you get an error, maybe try to follow these steps

1. Open your C: drive.
2. Locate a directory named Windows.
3. Inside the Windows directory, find a directory named SysWOW64.
4. Look for a file named SQLServerManager16 (your number might be different depending on the MS SQL Server installed on your machine).
5. Double-click the SQLServerManager16 file. It will ask you for some permissions; click "Yes."
6. Open SQL Server Network Configuration > Protocols for MSSQLSERVER.
7. On your right, you will see a few options. Double-click Named Pipes.
8. In the box that appears after you double-click Named Pipes, set Enabled to "Yes."

This should fix your problem, if it does

amanguniscode
Автор

I don't know if it is the way he explains things or his sexy but I enjoyed watching Database Star. He is definitely the best. Highest quality videos with no fluffs.

SantificaRolle
Автор

Thank you! The suggestions were on point, really needed this.

rezwanahmed
Автор

The video is so great, thank you!! I just have a some question, when starting the mssql-server instance by writing the docker command, if I wanted to make the database available for many devices (since i will use it in my flutter app that will be launched later), should I change the -p 1433:1433 to the port number of the remote server and use the IP address of that remote server in that case? and would that work?

mahinouralaa
Автор

Thank you so much! Btw you have very soothing voice.

TransportFeverLive
Автор

Include volume setup snd/or and restore of a db dump

noblenetdk
Автор

Thank you I have installed on synology nas on docker but I can not access the database, here is the return message: (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection had to be closed by the remote host).

medazz
Автор

there is no microsoft sql server available now, what can i do ?

mohammadsirajuddin
Автор

Thanks for your clear explanation.
i got this error what should i do????

Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:1433 -> 0.0.0.0:0: listen tcp 0.0.0.0:1433: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

reyhane
Автор

Perfect, I was stuck on how to connect to the server

yatmanwong
Автор

What if I have an Encrypt option and a Trust Server Certificate options what should I choose for those 2? False or True? I'm getting an error and not able to connect to Azure. Thank you.

rachelnavarro
Автор

Let me ask if I create a server using Docker as above, will it conflict with the server I already have. Specifically, before creating a server with Docker, I had a localhost server and was able to work on SSMS, then creating a server like that, I don't know if it will conflict? Because I see that there is currently a server running at 1433 but continue to create another server and also run on 1433, so I think there is a conflict.

taiphanvan
Автор

THANK YOU SO MUCH MASTER You helped me a lot!!!

keeponwishing
Автор

What if I just want to connect form sql server without azure, when I try to connect doesn’t let me

mafer
Автор

How can I get the connection string from the container that I've just created? Nice video btw!

filresto
Автор

hello, i got below connection error after created new database connection.

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. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server)

SomoradaneHeng
Автор

Hi dear. I have an issue. I lost my database connection. I want to reconnect but need help due to this message error.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Could you verify that the instance name is correct and that SQL Server is configured to allow remote connections? (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server)

I use a MacBook Pro. Please get me on Mac, NOT Windows. I appreciate your effort.

SarchlO.Mohammed
Автор

_THANK YOU!! I HAVE LOOKED EVERYWHERE. I was getting a login failure. but your info fixed that.

kisanailsproacademyeducato