Docker installs sql-server and uses navicat to import the backup database.
1. Docker installs sql-server database
Pull the image and install the container
# 拉取镜像
docker pull mcr.microsoft.com/mssql/server:2017-latest
# 创建容器
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=sqlserver123456" \
-v /sql-server/log:/var/opt/mssql/log \
-v /sql-server/data:/var/opt/mssql/data \
-v /sql-server/external:/var/opt/mssql/external \
-p 1433:1433 --name sqlserver -d mcr.microsoft.com/mssql/server:2017-latest
2. Use navicat to connect to sql-server
Click InstallFile before connectingsql-server
After the installation is complete, enter relevant information to connect, user name and The password is predictable when creating the container above. msodbcsql_64.msi
Username: sa Password: sqlserver123456
3. Use navicat to import the backup database
1. Step 1: Select the data source to be backed up
- Erection
sql-server
Connection - Create an empty database
AERS3
- Close the database, click
SQL Server备份
button, and click on the whiteboard on the right - choose
从文件还原选项
- Put the files that need to be backed up and restored
bak
into the server'sexternal
, which will be mapped inside the container 添加设备
,choicebak
text item
2. Step 2 (Select a backup plan and set the restore file location information)
- Choose a backup plan
- The settings need to be restored to the corresponding database data file of the backup (AERS3.ndf: AERS3 data information; AERS3_log.ldf: AERS3 operation log information)
- Click to generate SQL
- Click
还原
button
and the execution is successful!