mssql-server並不支持macOX,一般須要安裝一個虛擬機,但如今有了Docker以後,一切都變得簡單了。linux
首先,你須要安裝Docker,這個很簡單。推薦使用最新版docker。git
安裝Docker以後,須要配置國內的阿里雲鏡像(參考我上一篇博客),速度很是快。sql
因爲微軟sqlserver已經出了linux版本了,安裝mssql-server-linux(點我)。docker
官方的文檔和說明已經很詳細了,這裏須要注意一點,SA的密碼必定要設置成強密碼,否則回報以下的錯誤:bash
Microsoft(R) SQL Server(R) setup failed with error code 1. Please check the setup log in /var/opt/mssql/log for more information.
注意,Mac下不支持目錄映射。sqlserver
如何你用-v參數映射了磁盤目錄,會報如下錯誤:阿里雲
2017-01-04 03:36:27.37 Server Error: 17113, Severity: 16, State: 1. 2017-01-04 03:36:27.37 Server Error 2(The system cannot find the file specified.) occurred while opening file 'C:\var\opt\mssql\data\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary. 2017-01-04 03:36:27.37 Server SQL Server shutdown has been initiated