Connecting to SQL Server
In order to connect to the SQL Server from Terminal or command Line of your MacOs , you need to follow the steps given below :-
- First you need to install “sql-cli” tool which is a command-line tool by running the following command. This will allow you to run SQL Server instance queries and commands directly in Terminal.
sudo npm install -g sql-cli
- After “sqi-cli” is installed, by using following command you can connect with your SQL server.
mssql -u sa -p DB_Password
The command consists certain parameters described as :-
-u: It is used to specify the username to connect with your database. In above example, we have used “sa” as database username.
-p: It defines the database password. In above example, we have used “DB_Password” as database password.
Finally, After successfully connecting with your SQL Server you will seen a message response as given below:
Output:
Connecting to localhost…done
sql-cli version 0.6.2
Enter “.help” for usage hints.
mssql
Now, you have successfully install and connected to SQL Server express in your Mac system.
How to Install SQL Server on MacOS?
In this article, we are going to learn “How to install SQL Server Express in MacOs”. Now, before we jump to the setup part, Let’s learn about SQL Server Express. So, SQL Server Express is an open-source RDBMS database management system i.e. Relational database management system which is used to store, update, and access the data stored in different relational databases. It provides many benefits such as scalability, security, and business intelligence.