Open In App

How to Install SQL Client on MacOS?

SQL Client is an important tool for managing SQL Server. SQL Client is just a command line interface which helps a user to communicate with the Database. The data which is present on SQL Server can be shown or modified with the help of SQL Client. For example, a user can run SQL commands on SQL Client like,

Select First_name, Last_name, Salary from Employee;



Where the Employee table is present in database of the user. Once SQL Server is installed on MacBook, SQL Client is used to connect to it and run queries. In this article, we will learn how to install SQL Client on macOS. 

Installing SQL Client in MacOS

Below is the Step-by-Step process to install SQL Client.



Step 1: Open Terminal Window and run the following command to install SQL Client.

npm install -g sql-cli

If the above command does not work, then try,

 

sudo npm install -g sql-cli

Step 2: Connect to SQL Server- To connect to SQL Server, use the ‘mssql’ command, followed by the username and password parameters.

mssql -u sa -p <password>

 

Step 3: Run a command to check if it is connected or not.

select @@version

 

If the above command runs, it means the database is connected.

Article Tags :