ติดตั้ง MSSQL Express ด้วย Docker บน macos M1
1.ติดตั้ง Docker
ปรับ config เพิ่ม ram เป็น 4GB
- ติดตั้ง SqlServer Express
ขั้นตอนตาม How to Install SQL Server on MacOS
Step 1: Pull the Docker Image Download the Azure SQL Edge image to your system:
docker pull mcr.microsoft.com/azure-sql-edge
Step 2: Run the Docker Container When the image successfully downloads to your machine, run the container using the following command:
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=Strong.Pwd-123' -p 1433:1433 --name sqledge -d mcr.microsoft.com/azure-sql-edge
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=Strong.Pwd-123' -p 1433:1433 --name sqlexpress03 -d mcr.microsoft.com/azure-sql-edge
Step 3: Check the Container Ensure that the Azure SQL Edge container is running properly:
docker ps
Step 4: Access the Container with Bash Shell With the container running, you can connect to Azure SQL Edge by using the docker exec command:
sudo docker exec -it sqledge "bash"
Step 5: Connect to the Database Once inside the container, connect to the database using the sqlcmd tool:
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA
อ้างอิง:
Relate topics
- nginx on macOS
- Burn ISO Image to USB on macOS
- My app on macOS - ใช้แอบอะไรบ้างนะบน macOS
- macOS/Flutter : Exception: Error running pod install
- Hammerspoon: ทดลองเล่นดู
- macOS 12 Monterey: Web Server Setup/Apache/MariaDB/PHP Multiple Versions
- Mirror iPad to a Mac
- Xcode on Mac App Store can't install , show disk space not enough