您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Docker下安装Sqlserver(mssql)

bubuko 2022/1/25 19:54:07 sqlserver 字数 5170 阅读 1245 来源 http://www.bubuko.com/infolist-5-1.html

1.服务器需要大于2G内存。如果不够则可能无法正常启动,查看日志报如下错误:This program requires a machine with at least 2000 megabytes of memory 2.获取sqlserver镜像 docker pull mcr.microsoft ...

1.服务器需要大于2G内存。如果不够则可能无法正常启动,查看日志报如下错误:
This program requires a machine with at least 2000 megabytes of memory

技术分享图片

 

 

2.获取sqlserver镜像

docker pull mcr.microsoft.com/mssql/server:2017-latest

镜像下载成功后,运行镜像

docker run -e ACCEPT_EULA=Y -e MSSQL_PID="Developer" -e MSSQL_SA_PASSWORD="sa" -e MSSQL_TCP_PORT=1234 -p 1234:1234 --name sqlserver -d mcr.microsoft.com/mssql/server:2017-latest

 

运行容器报错:
SQL Server 2019 will run as non-root by default.
This container is running as user root.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
The SQL Server End-User License Agreement (EULA) must be accepted before SQL
Server can start. The license terms for this product can be downloaded from
http://go.microsoft.com/fwlink/?LinkId=746388.

You can accept the EULA by specifying the --accept-eula command line option,
setting the ACCEPT_EULA environment variable, or using the mssql-conf tool.

 3.登录sqlserver容器

docker exec -it sqlserver "bash"

4.连接sqlserver

/opt/mssql-tools/bin/sqlcmd -S localhost,1234 -U SA -P Lc19951127.

技术分享图片

 

 技术分享图片

 

 

5.执行sql

 

英文的操作系统  对于有中文的  我定义类型  nvarchar(100)  

插入时:
insert into users values(N‘张三‘);
go

 技术分享图片

 

 这个是docker for windows 安装的,接下来我会去mac里具体使用

 

参考:https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-configure-docker?view=sql-server-2017

Docker下安装Sqlserver(mssql)

原文:https://www.cnblogs.com/LiChen19951127/p/12802965.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶