install sql server on macOS

SQL Server is a relational database management system developed by Microsoft, which mainly runs on the Windows platform. However, for macOS users, there are two ways to install SQL Server:

  1. Docker installation:

    • Install Docker: First, you need to install Docker on macOS. You can download it from the official Docker website and follow the instructions to install it.
    • Search and pull the SQL Server image: In the Docker client, search for the SQL Server image and pull it. The following commands can be used:
      docker search mssql-server
      docker pull mcr.microsoft.com/mssql/server
      
    • Run the SQL Server container: Use the following command to create and run the SQL Server container:

      docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrongPassword' -p 1433:1433 --name sql_server_container -d mcr.microsoft.com/mssql/server
      

      • Note, replace "YourStrongPassword" with the strong password you want to set.
      • Connect to SQL Server: Use SQL Server client tools (such as SQL Server Management Studio, Azure Data Studio) to connect to the SQL Server container. The connection address is "localhost" (or the IP address of the Docker host), and the port is 1433.
    • Azure Data Studio installation:

      • Install Azure Data Studio: Azure Data Studio is a cross-platform database tool that supports connecting and managing SQL Server. You can download it from the Azure Data Studio official website and follow the instructions to install it.
      • Install the SQL Server extension: In Azure Data Studio, install the SQL Server extension. Open Azure Data Studio, click the extension icon in the left sidebar, search for and install the "SQL Server (mssql)" extension.
      • Connect to SQL Server: In Azure Data Studio, click the "Server" icon in the left sidebar, then click the "+" button in the upper right corner and select "Connect to Server". Enter the connection information, including the server name (which can be a local or remote server), authentication type and credentials, and click Connect.
    • Whether you choose to use Docker or Azure Data Studio, you can install and connect to SQL Server on macOS. According to your needs and preferences, choose the installation method that suits you.

    • The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

      Solution reference:

      Docker on Mac M1 gives: "The requested image platform (linux/amd64) does not match the detected host platform" answer - Code World

Guess you like

Origin blog.csdn.net/qq_23080741/article/details/131317918