Installing SQL Server Express in macOS

Instructions:

  1. Open `Terminal`.
    Application/Utilities/Terminal.app
  2. Install the Homebrew package manager system.
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Test Homebrew installation.
    brew doctor
  4. Install Docker using Homebrew.
    brew install docker
  5. Run Docker and download the latest package of SQL Server.
    sudo docker pull mcr.microsoft.com/mssql/server:2017-latest
  6. Accept the EULA (End-User Licensing Agreement) and enter a `sa` (system administrator) password (position shown below as `<YourStrong!Passw0rd>`). This is the account that will run SQL Server using port 1433 to access container `sql1`.
    sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' \
      -p 1433:1433 --name sql1 \
      -d mcr.microsoft.com/mssql/server:2017-latest
  7. View all containers created. You should see container `sql1`.
    sudo docker ps -a
  8. Connect to SQL Server in container `sql1`.
    sudo docker exec -it sql1 "bash"
  9. Connect to `sqlcmd` (SQL Command).
    /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YourNewStrong!Passw0rd>'
  10. At this point, you can stop the execution of `sqlcmd`.
    QUIT
  11. Install DBeaver Community Edition (CE).
    https://dbeaver.io/files/dbeaver-ce-latest-installer.pkg
  12. Connect to SQL Server using a client. In this tutorial, we will cover DBeaver.
  13. Run DBeaver.
  14. Select `Connect to database`.In the dialog box, select `SQL Server`.
    • Accept the default values.Host: `localhost`
    • Port: `1433`
    • Database/schema: `master`
    • Authentication: `SQL Server Authentication`
    • User name: `sa`
    • Password: `<YourStrong!Passw0rd>`
    • Save password locally: checked
    • Trust Server Certificate: checked
    • Show All Schemas: your choice, unchecked by default
    • Advanced Settings: `Network settings (SSH, SSL...)` & `Connection details (name, type...)`
    • Driver name: `MS SQL Server / Sql Server`
  15. At this point, you can test the connection or click the `Finish` button.

Resources

2 thoughts on “Installing SQL Server Express in macOS

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.