docker安装mssql 本文共有1715个字,关键词: 直接上代码 ```bash #docker pull registry.cn-hangzhou.aliyuncs.com/newbe36524/server:2019-latest #docker tag registry.cn-hangzhou.aliyuncs.com/newbe36524/server:2019-latest mcr.microsoft.com/mssql/server:2019-latest docker pull mcr.microsoft.com/mssql/server:2019-latest mkdir -p /home/docker/mssql chown -R 10001:0 /home/docker/mssql docker run --name mssql --hostname mssql1 -p 1433:1433 -e 'ACCEPT_EULA=Y' -e 'MSSQL_PID=这里填你的授权秘钥' -e 'SA_PASSWORD=@Mssql2019' -v /home/docker/mssql:/var/opt/mssql -d mcr.microsoft.com/mssql/server:2019-latest #SQL Server 2019密钥: #HMWJ3-KY3J2-NMVD7-KG4JR-X2G8G #PMBDC-FXVM3-T777P-N4FY8-PKFF4 docker exec -it mssql /bin/bash /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '@Mssql2019' #navicat #http://www.navicat.com.cn/download/navicat-premium#lin #以下为还原数据库 #sudo docker cp 123.bak mssql:/var/opt/mssql/backup #sudo docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '@Mssql2019' -Q 'RESTORE FILELISTONLY FROM DISK = "/var/opt/mssql/backup/T123.bak"' | tr -s ' ' | cut -d ' ' -f 1-2 #sudo docker exec -it --user root mssql "bash" #sudo docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '@Mssql2019' -Q 'RESTORE DATABASE 123 FROM DISK = "/var/opt/mssql/backup/123.bak" WITH MOVE "TeaPotData" TO"/var/opt/mssql/data/123.mdf", MOVE "TeaPotData_Log" TO "/var/opt/mssql/data/123.ldf"'' ``` ```bash #开启代理 #SQL执行 EXEC sp_configure 'show advanced', 1; RECONFIGURE; EXEC sp_configure 'allow updates', 0; RECONFIGURE; EXEC sp_configure 'Agent XPs', 1; RECONFIGURE; GO #bash sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true sudo systemctl restart mssql-server ``` 「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」 赞赏 × 梦白沙 (๑>ڡ<)☆谢谢老板~ 1元 2元 5元 10元 50元 任意金额 2元 使用微信扫描二维码完成支付 版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。 Docker 2022-10-22 评论 474 次浏览