티스토리 뷰

셋팅

docker-compose.yml

version: '3.4'
 
services:
mssql:
image: mcr.microsoft.com/mssql/server:latest
environment:
- ACCEPT_EULA=Y
- MSSQL_PID=Developer
- SA_PASSWORD=sa@dpsekfrh.zja
volumes:
- dbdata:/var/opt/mssql
ports:
- "1433:1433"
 
volumes:
dbdata:

docker 컨테이너 띄우기

터미널에서 아래 명령 실행

$ docker-compose up
$ docker-compose ps

접속

TablePlus 에서 sa 로 접속

host: localhost

mssql 로그인 계정 생성, 권한 부여

use endalgo;
 
CREATE LOGIN endalgo WITH PASSWORD=N'dpsekfrh-Passw0rd';
CREATE USER endalgo FOR LOGIN endalgo;
ALTER ROLE db_owner ADD MEMBER endalgo;

생성한 로그인 계정으로 mssql cmd 접속해보기

터미널에서 아래 명령 실행

$ docker-compose exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U endalgo -P 'dpsekfrh-Passw0rd'
 
1> use mydb
2> go
Changed database context to 'mydb'
1> exit

 

댓글
댓글쓰기 폼
Total
803,199
Today
23
Yesterday
241
«   2019/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
글 보관함