Instructions:
- Open `Terminal`.
Application/Utilities/Terminal.app
- Install the Homebrew package manager system.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Test Homebrew installation.
brew doctor
- Install Docker using Homebrew.
brew install docker
- Run Docker and download the latest package of SQL Server.
sudo docker pull mcr.microsoft.com/mssql/server:2017-latest
- 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
- View all containers created. You should see container `sql1`.
sudo docker ps -a
- Connect to SQL Server in container `sql1`.
sudo docker exec -it sql1 "bash"
- Connect to `sqlcmd` (SQL Command).
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YourNewStrong!Passw0rd>'
- At this point, you can stop the execution of `sqlcmd`.
QUIT
- Install DBeaver Community Edition (CE).
https://dbeaver.io/files/dbeaver-ce-latest-installer.pkg - Connect to SQL Server using a client. In this tutorial, we will cover DBeaver.
- Run DBeaver.
- 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`
- At this point, you can test the connection or click the `Finish` button.
Resources
Pingback: Installing SQL Server Express in macOS #2 – F.Olvera
Pingback: Installing SQL Server Express in macOS #3 – F.Olvera