Link Search Menu Expand Document

Install MS SqlServer on Mac

Table of contents

  1. Prerequisite
    1. Choose A Place on your Mac
    2. Create docker-compose.yml
    3. Generate your SqlServer Container
    4. Additional Commands
  2. Connect to Sql Server
    1. Prerequisite
    2. Open your Azure Data Studio
    3. Click “Create a connection”
    4. If everything goes well, you should see we connected sql server successfully.

Prerequisite

  1. You’re using Mac

  2. You should have Docker installed (if not, please check this link to install, and get back)

Choose A Place on your Mac

You can choose anywhere to store a docker-compose file. For example,

Create docker-compose.yml

Type or copy the following code into it. Please take care of the indents (If you encounter any issue of the syntax of YML, please use this Online YML Checker) to help you.

[Optional] change the password to yours.

version:  "3"

services:
  mssql:
    image: mcr.microsoft.com/azure-sql-edge
    cap_add: [ 'SYS_PTRACE' ]
    environment:
      - ACCEPT_EULA=1
      - MSSQL_SA_PASSWORD=StrongPwd123
    ports:
      - "1433:1433"
    hostname: mssql

volumes:
    mssql-azuresql-edge-data:

Generate your SqlServer Container

Open your terminal and switch to the path as same as your docker-compose.yml file. Type the following command.

docker-compose up

If everything goes well, you would see a similar outputs like me.

Additional Commands

You can press “Ctrl-C” to stop the container. And then you can use “docer-compose start” to start you container in the future.

dockcer-compose start

After you want to stop your container. Please use below command.

dockcer-compose stop

Connect to Sql Server

Prerequisite

  1. Installed Azure Data Studio

  2. A Running Sql Server

Open your Azure Data Studio

Click “Create a connection”

If everything goes well, you should see we connected sql server successfully.