Linux:ways connnection


Following are some ways to connect to sql server on linux from windows and linux:

Ways Of Connecting To Sql Server On Linux, Putty, Ssms, Or Sqlcmd Tool

Prerequisites:

--ipaddress of linux system
--active sql server services
Modes of connection:
        --Existing linux machine with sqlcmd tools
    --using putty from windows machine
        --using SSMS from windows

Check SQL server services:

#systemctl status mssql-server


#get ip address 
#ifconfig

Install sqlcmd SQL Server command-line tools on Linux


To know more about SQLCMD tool, here you go and here:

To use sqlcmd tool you need to install package:
Use this link to get the required package, choose the latest version.

Open the terminal and locate to downloads directory:


Install the package:
#rpm-ivh mssqltools

If you get any dependencies error when installing package go here

After installationAdd /opt/mssql-tools/bin/ to your PATH environment variable in a bash shell.

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc

Check if SQLCMD is installed or not:

Run sqlcmd with parameters for your SQL Server name (-S), the user name (-U), and the password (-P). In this tutorial, you are connecting locally, so the server name is localhost. The user name is SA and the password is the one you provided for the SA account during setup.


Using Putty tools on Windows to connect to SQL Server on Linux


PuTTY is open source software that is available.

Download putty:

Get ip address of linux where sql server is instlled
#ifconfig

Configure putty:
Port 22 is for SSH which is typically used to log into a remote machine and execute commands


Press Yes to security alert:

Give your credentials that used to login your linux system:



Check the sql server ?services

#systemctl status mssql-server.service

Connect to sql server 
#sqlcmd -S localhost -U SA -P ‘password’

Using SSMS on Windows to Connect SQL Server on Linux

Through SSMS:
Get ip address and Connect using SA or another login account and password:

Check Server Properties:

Querying and checking version, locations of database files:

Name

Azure Backup Database Clustering Crash Dumps DBCC Deadlock Link Server Log Shipping Maintenance Migration Mirroring Monitoring Performance Tuning Permissions Post Installations Prerequisites Replication Restore Database SQL Installations SQL on Linux SQL Uninstallations SSIS T-SQL Windows Server
false
ltr
item
hybriddba.blogspot.com: Linux:ways connnection
Linux:ways connnection
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm642uajPQPiJ5n4NXcXFyGImd2rjNN-vyBE5EQqgK65Tym8Z2siLoaYqpXH4Ft03kXQbGkItyRjrAMuM4Js6X5KlWGzDFn25r1w3c-CsXDCbdked52f6oGPXCMpha5JZdYHl51alC_QIV/s1600/1579483080186580-0.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm642uajPQPiJ5n4NXcXFyGImd2rjNN-vyBE5EQqgK65Tym8Z2siLoaYqpXH4Ft03kXQbGkItyRjrAMuM4Js6X5KlWGzDFn25r1w3c-CsXDCbdked52f6oGPXCMpha5JZdYHl51alC_QIV/s72-c/1579483080186580-0.png
hybriddba.blogspot.com
https://hybriddba.blogspot.com/2019/05/linuxways-connnection.html
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/2019/05/linuxways-connnection.html
true
7679493960263860249
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy