Are you looking for steps to install SQL tools on Redhat offline? Take a peek at this blog.
Here at Bobcares, we have seen several such SQL related queries as part of our Server Management Services for web hosts and online service providers.
Today we’ll take a look at how to install SQL tools on Redhat without the internet.
Know more about SQL tools
SQL Tools is a development tool pack that provides many essential features for any Microsoft SQL Server developer.
We can easily install the SQL tools with internet access. However, it is a bit complex task to install it offline.
The mssql-tools package contains two utilities i.e. sqlcmd and bcp which we will be installing now.
How to install SQL tools on Redhat without internet/offline
Here are the steps our Support Engineers follow to install the SQL tools without an internet connection.
1. Download & Copy SQL Tools Packages to Linux Server
First, we check whether the SQL server is installed or not on the machine. For that, we run the below command.
$ systemctl status mssql-server
As a result, it must display that the SQL server is running on the machine.
Now, it’s time to check if the SQL tools are installed on the machine or not. For that, we run the below command.
$ sqlcmd
If the above command shows a result of ‘No such file or directory’ then it means that the SQL tools are not yet installed.
So now let’s start with downloading the rpm packages for SQL tools. You can download these packages on a machine that is connected to the internet. Here is the list of rpm packages that you would need to download.
msodbcsql-13.1.9.0-1.x86_64.rpm
mssql-tools-14.0.5.0-1.x86_64.rpm
First, we need to install msodbcsql as the SQL Tools package depends on it. Installing it will avoid any dependency issue. After downloading the package to your local PC, copy the downloaded packages to the RedHat Linux server that will be running without an internet connection.
You can use any tool, application, or method to copy this file from localhost to Linux server. Here, we used the WinSCP tool to copy this file from the local machine to the Linux server.
Now we launch the WinSCP tool and make a connection to the Red Hat Linux server. Enter the login details and establish a connection.
There will be two panes in the WinSCP window. The files in the left side pane are your local system and the right side pane is your target Linux server.
Now we need to drag the downloaded rpm packages from the left side pane and drop it to the right side pane. Now the files are copied and we can see the files in both side panes.
We have copied the rpm packages to location \home\techyaz\Packages\.
2. Installing SQL Tools on Redhat
Now, we shall install the packages. For that, run the below command.
sudo yum localinstall msodbcsql-13.1.9.0-1.x86_64.rpm
Sometimes, it may fail due to the dependency unixODBC package. So make sure you install it.
For that, download the unixODBC package on the localhost and copy it to the Linux server using WinSCP. Run the below command to check if the file is copied on the server.
ls -lrt
Then you can run the command to install the package.
sudo yum localinstall unixODBC-2.3.2-6.fc22.x86_64.rpm
Once the installation will start, it will check dependencies and ask you to type y to proceed with the installation.
We have now installed the required package for msodbc package. So go ahead and install this package again. Run the below command to execute the installation.
sudo yum localinstall unixODBC-2.3.2-6.fc22.x86_64.rpm
The setup will ask for confirmation. So press Y and hit Enter to continue the installation process.
Then you will be asked to accept the license terms. Type YES to accept the license terms and press enter to proceed.
Next, install the mssql-tools package. For that, run the below command.
sudo yum localinstall mssql-tools-14.0.5.0-1.x86_64.rpm
Your confirmation is required to complete the installation. So press Y and press Enter.
Then you will be asked to accept the license terms. Type YES to accept the license terms and press enter to proceed.
Now, you must be able to see that the SQL Server Tools have been installed on this server. Then you can go ahead and run the below command to confirm the installation.
sqlcmd
In case, if you receive the error ‘command not found’ then it means that the RHEL is not able to recognize the SQL tools. So now we shall add /opt/mssql-tools/bin/ to your PATH environment variable in a bash shell. For that, run the below commands.
Here is the command to make sqlcmd/bcp accessible from the bash shell for login sessions, and modify your PATH in the ~/.bash_profile file.
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
Then to make sqlcmd/bcp accessible from the bash shell for interactive/non-login sessions, and modify the PATH in the ~/.bashrc file
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
3. Validate the SQL tools Installation
Finally, it’s time to validate the installation. So run the below command.
sqlcmd
Now you must see that Linux is able to recognize the utility.
[Need any assistance in fixing SQL queries? – We’ll help you]
Conclusion
In short, Today, we saw how our Support Engineers install SQL tools on Redhat offline.
0 Comments