Open In App

How to Install SQL Client on MacOS?

Last Updated : 11 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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,

Command-to-install-sql-client

 

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>

Connecting-to-sql-server

 

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

select @@version

Running-command-to-check-connection

 

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


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads