Try   HackMD

M1 上使用 MS SQL Server

只有SSMS會在虛擬機環境安裝, 其他請使用Mac原生環境安裝

安裝 Docker

下載連結

安裝 Azure SQL Edge

截至目前因為 MS SQL Server 仍不支持 M1 ARM 晶片, 所以由 Azure SQL Edge 代替

安裝指令

確定 docker 有在運行後, 開啟終端機貼上如下指令

docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=MyPass@word" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge

附註

要特別注意上方安裝指令內的
"MSSQL_SA_PASSWORD=MyPass@word"
"MSSQL_USER=SA"
會是後續使用 SQL Login 連線至 server 的使用者名稱及密碼

文件位置: Azure SQL Edge

安裝後在docker上應該會如下圖:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

連線至資料庫

在連線至資料庫之前, 都要記得把安裝在 docker 內的 azure sql edge 容器 運行起來

使用 Azure Data Studio

安裝

下載連結

連線

  1. 開啟 Azure Data Studio
  2. 建立新連線(如下圖)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. 設定連線

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

使用 SSMS

  1. 在虛擬機安裝SSMS
  2. 開啟 SSMS 並建立新連線
需要特別注意將伺服器名稱替換為 10.211.55.2
讓虛擬機內的SSMS可以連線至Mac本機IP

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

參考

How to Install SQL Server on an M1 Mac (ARM64)
如何在 Parallel Desktop 使用 Docker for Mac ?