Deepin-Docker-Mssql2022
系统准备
1.1.映射目录:
/home/bizuser/soft/mssql/sql2022/data
/home/bizuser/soft/mssql/sql2022/backup
1.2目录授权
chmod a+rwx /home/bizuser/soft/mssql/sql2022/data
chmod a+rwx /home/bizuser/soft/mssql/sql2022/backup
镜像准备
2.1镜像下载
docker pull mcr.microsoft.com/mssql/server:2022-latest
2.2容器启动
sudo docker run --restart=always \ -e "ACCEPT_EULA=Y" \ -e "SA_PASSWORD=Demo@123456" \ -p 1433:1433 --name mssql2022 -h mssql \ -v /home/bizuser/soft/mssql/sql2022/data/:/var/opt/mssql/data/ \ -v /home/bizuser/soft/mssql/sql2022/backup/directory:/var/opt/mssql/backup \ -d mcr.microsoft.com/mssql/server:2022-latest
端口设置
3.1端口放行
ufw allow 1433
连接测试
4.1工具测试
显示测试Ok
密码修改
5.1修改示范
## 修改密码 sudo docker exec -it mssql2022 /opt/mssql-tools/bin/sqlcmd \ -S localhost -U SA -P "Demo@123456" \ -Q 'ALTER LOGIN SA WITH PASSWORD="Demo@2020>"'