BEFORE WE BEGIN WE SELL SUPPORT KID ON HOW TO OPERATE THIS DATABASE LIVE COMMENT OR CHAT LIVE TO US … .
Quickstart: Install SQL Server and create a database on Ubuntu … .
In this quickstart, you install SQL Server 2025 . Then you can connect with sqlcmd to create your first database and run queries.
OFFLINE INSTALL … .
GET THE PACKAGE FOR DEBIAN AND RPM FROM
https://drive.google.com/drive/folders/1bL2ITPkHEJbu2CMxylr3wHursj1WAzxc?usp=sharing
Your password should follow the SQL Server default password policy. By default, the password must be at least eight characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, base-10 digits, and symbols. Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible.
- Install the database engine package. Use one of the following commands based on your platform. Replace the package file name in this example with the exact name you downloaded.PlatformPackage install command :
RHEL sudo dnf -y install ./mssql-server_versionnumber.x86_64.rpm
- Ubuntu
sudo apt-get install ./mssql-server_versionnumber_amd64.deb
THAT’S ALL FOR OFFLINE INSTALL … .
FOR ONLINE INSTALLATION :
UBUNTU :
STEP 1 :
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
STEP 2 Manually download and register the SQL Server Ubuntu repository:
curl -fsSL https://packages.microsoft.com/config/ubuntu/26.04/mssql-server-2025.list | sudo tee /etc/apt/sources.list.d/mssql-server-2025.list
INSTALL SQL SERVER
sudo apt-get update
sudo apt-get install -y mssql-server
After the package installation finishes, run mssql-conf setupand follow the prompts to set the saPassword and choose your edition. The following SQL Server editions are freely licensed: Evaluation, Developer, and Express.
sudo /opt/mssql/bin/mssql-conf setup
Your password should follow the SQL Server default password policy. By default, the password must be at least eight characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, base-10 digits, and symbols. Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible.
When the configuration is done, verify that the service is running:
Bash
systemctl status mssql-server --no-pager
If you plan to connect remotely, you might also need to open the SQL Server TCP port (default 1433) on your firewall.
At this point, SQL Server is running on your Ubuntu machine and is ready to use.
Disable the SA account as a best practice
When you connect to your SQL Server instance using the system administrator (sa) account for the first time after installation, it’s important for you to follow these steps, and then immediately disable the sa account as a security best practice.
- Create a new login, and make it a member of the sysadmin server role.
- Depending on whether you have a container or non-container deployment, enable Windows authentication, and create a new Windows-based login and add it to the sysadmin server role.
Install the SQL Server command-line tools
To create a database, you need to connect with a tool that can run Transact-SQL statements on SQL Server. The following steps install the SQL Server command-line tools: sqlcmd utility and bcp utility.
Use the following steps to install the mssql-tools18 for SQL Server 2025 (17.x) on Ubuntu
- Enter superuser mode.
- Bash
sudo su - Register the Microsoft repository for Ubuntu 24.04.Bash
curl -sSL -O https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb - Install the repository package:Bash
sudo dpkg -i packages-microsoft-prod.deb - Exit superuser mode.Bash
exit
- Update the sources list and run the installation command with the unixODBC developer package.Bash
sudo apt-get update sudo apt-get install mssql-tools18 unixodbc-devTo update to the latest version of mssql-tools, run the following commands: sudo apt-get update sudo apt-get install mssql-tools18- Optional: Add
/opt/mssql-tools18/bin/to yourPATHenvironment variable in a Bash shell. - To make
sqlcmdandbcpaccessible from the Bash shell for login sessions, modify yourPATHin the~/.bash_profilefile with the following command: echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile source ~/.bash_profileTo makesqlcmdandbcpaccessible from the Bash shell for interactive and non-login sessions, modify thePATHin the~/.bashrcfile with the following command:Bashecho 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc
Connect locally
The following steps use the sqlcmd utility to locally connect to your new SQL Server instance. Download and install the sqlcmd utility for Windows, Linux.
for windows : https://drive.google.com/drive/folders/1bL2ITPkHEJbu2CMxylr3wHursj1WAzxc?usp=sharing the one with .msi
Download and install sqlcmd (Go)
sqlcmd (Go) can be installed cross-platform, on Microsoft Windows, macOS, and Linux. Versions newer than 1.6 might not be available in all package managers. There’s no estimated date yet for their availability.
FOR LINUX :
Download and install sqlcmd (Go)
sqlcmd (Go) can be installed cross-platform, on Microsoft Windows, macOS, and Linux. Versions newer than 1.6 might not be available in all package managers. There’s no estimated date yet for their availability.
Choose one of the following options to install sqlcmd (Go) on Linux.
apt (Debian/Ubuntu)
- Import the public repository GPG keys.Bash
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc - Add the Microsoft repository, where the
ubuntu/20.04segment might bedebian/11,ubuntu/20.04, orubuntu/22.04. - Bash
add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)" - Install sqlcmd (Go) with apt.
- Bash
apt-get update apt-get install sqlcmd
yum (Fedora) / CENTOS / REDHAT
- Import the Microsoft repository key.Bash
rpm --import https://packages.microsoft.com/keys/microsoft.asc- Download the repository configuration file, where the
fedora/32segment might beopensuse/42.3,rhel/8, orsles/15. - If the version of your OS doesn’t directly correspond to one of those options, you might be able to use a repository configuration file from a version.Bash
curl -o /etc/yum.repos.d/packages-microsoft-com-prod.repo https://packages.microsoft.com/config/fedora/40/prod.repo- Install sqlcmd (Go) with yum.Bash
dnf install sqlcmd
FOR WINDOWS DOWNLOAD FROM :
https://drive.google.com/drive/folders/1bL2ITPkHEJbu2CMxylr3wHursj1WAzxc?usp=sharing
License and pricing
SQL Server is licensed the same for Linux and Windows. For more information about SQL Server licensing and pricing,
SEE OUR LICENSE PART … .
- Run
sqlcmdwith parameters for your SQL Server name (-S), the user name (-U), and the password (-P). In this tutorial, you connect locally, so the server name islocalhost. The user name issaand the password is the one you provided for thesaaccount during setup. sqlcmd -S localhost -U sa -P '<password>'NoteNewer versions ofsqlcmdare secure by default. For more information about connection encryption, If the connection doesn’t succeed, you can add the-Nooption tosqlcmdto specify that encryption is optional, not mandatory.You can omit the password on the command line to be prompted to enter it.If you later decide to connect remotely, specify the machine name or IP address for the-Sparameter, and make sure port 1433 is open on your firewall.- If successful, you should get to a
sqlcmdcommand prompt:1>. - If you get a connection failure, first attempt to diagnose the problem from the error message.
Create and query data
The following sections walk you through using sqlcmd to create a new database, add data, and run a basic query.
For more information about writing Transact-SQL statements and queries. ASK FOR SUPPORT OR LIVE CHAT … .
Create a new database
The following steps create a new database named TestDB.
- From the
sqlcmdcommand prompt, paste the following Transact-SQL command to create a test database: CREATE DATABASE TestDB;- On the next line, write a query to return the name of all of the databases on your server:
SELECT Name FROM sys.databases;- The previous two commands aren’t executed immediately. You must type
GOon a new line to execute the previous commands: GO
Insert data
Next create a new table, dbo.Inventory, and insert two new rows.
- From the
sqlcmdcommand prompt, switch context to the newTestDBdatabase: USE TestDB;- Create new table named
dbo.Inventory: CREATE TABLE dbo.Inventory ( id INT, name NVARCHAR (50), quantity INT, PRIMARY KEY (id) );- Insert data into the new table:
INSERT INTO dbo.Inventory VALUES (1, 'banana', 150); INSERT INTO dbo.Inventory VALUES (2, 'orange', 154);- Type
GOto execute the previous commands: GO
Select data
Now, run a query to return data from the dbo.Inventory table.
- From the
sqlcmdcommand prompt, enter a query that returns rows from thedbo.Inventorytable where the quantity is greater than 152: SELECT * FROM dbo.Inventory WHERE quantity > 152;- Execute the command:
GO
Exit the sqlcmd command prompt
To end your sqlcmd session, type QUIT:
SQL
QUIT
TUTORIAL FOR RPM MICROSOFT SQL LINUX WITH RPM LIKE CENTOS FEDORA AND REDHAT
Quickstart: Install SQL Server and create a database on Red Hat Enterprise Linux
In this quickstart, you install SQL Server 2025 (17.x) on Red Hat Enterprise Linux (RHEL) 9.x or 10.x. Then you connect by using sqlcmd to create your first database and run queries.
To configure SQL Server on RHEL 10, run the following commands in a terminal to install the mssql-server package:
- Download the SQL Server 2025 (17.x) Red Hat 10 repository configuration file:
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/10/mssql-server-2025.repoTip- If you want to install a different version of SQL Server, versions of this article.
- Run the following command to install SQL Server:
sudo dnf install -y mssql-server- Optionally, if you want to run SQL Server as a confined application, install the
mssql-server-selinuxpackage, which enables custom policies.sudo dnf install -y mssql-server-selinux - After the package installation finishes, run
mssql-conf setupby using its full path. Follow the prompts to set thesapassword and choose your edition. As a reminder, the following SQL Server editions are freely licensed: Evaluation, Developer, and Express. sudo /opt/mssql/bin/mssql-conf setup
Your password should follow the SQL Server default password policy. By default, the password must be at least eight characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, base-10 digits, and symbols. Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible.
- When the configuration is done, verify that the service is running:Bash
systemctl status mssql-server - To allow remote connections, open the SQL Server port on the RHEL firewall. The default SQL Server port is TCP 1433. If you’re using FirewallD for your firewall, use the following commands:Bash
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent sudo firewall-cmd --reload
At this point, SQL Server is running on your RHEL machine and is ready to use.
Disable the SA account as a best practice
When you connect to your SQL Server instance using the system administrator (sa) account for the first time after installation, it’s important for you to follow these steps, and then immediately disable the sa account as a security best practice.
- Create a new login, and make it a member of the sysadmin server role.
- Depending on whether you have a container or non-container deployment, enable Windows authentication, and create a new Windows-based login and add it to the sysadmin server role.
- Connect to the SQL Server instance using the new login you created.
- Disable the
saaccount, as recommended for security best practice.
Install the SQL Server command-line tools
To create a database, you need to connect to the SQL Server instance using a tool that can run Transact-SQL statements. The following steps install the SQL Server command-line tools: sqlcmd utility and bcp utility.
Use the following steps to install the mssql-tools18 on Red Hat Enterprise Linux.
- Download the Microsoft Red Hat repository configuration file.
- For Red Hat 10, use the following command to download the Microsoft Red Hat repository configuration file from the RHEL 9 repo. The same versions of tools also work for RHEL 10.
curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
- f you had a previous version of mssql-tools installed, remove any older unixODBC packages.
sudo yum remove mssql-tools unixODBC-utf16 unixODBC-utf16-devel- Run the following commands to install mssql-tools18 with the unixODBC developer package.
sudo yum install -y mssql-tools18 unixODBC-develTo update to the latest version of mssql-tools, run the following commands:sudo yum check-update sudo yum update mssql-tools18- Add
/opt/mssql-tools18/bin/to yourPATHenvironment variable in a Bash shell.To makesqlcmdandbcpaccessible from the Bash shell for login sessions, modify yourPATHin the~/.bash_profilefile with the following command: echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile source ~/.bash_profile- To make
sqlcmdandbcpaccessible from the Bash shell for interactive and non-login sessions, modify thePATHin the~/.bashrcfile with the following command: echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc
- Run
sqlcmdwith parameters for your SQL Server name (-S), the user name (-U), and the password (-P). In this tutorial, you connect locally, so the server name islocalhost. The user name issaand the password is the one you provided for thesaaccount during setup. sqlcmd -S localhost -U sa -P '<password>'NoteNewer versions ofsqlcmdare secure by default. For more information about connection encryption, see sqlcmd utility for Windows, Linux and macOS. If the connection doesn’t succeed, you can add the-Nooption tosqlcmdto specify that encryption is optional, not mandatory.You can omit the password on the command line to be prompted to enter it.If you later decide to connect remotely, specify the machine name or IP address for the-Sparameter, and make sure port 1433 is open on your firewall.- If successful, you should get to a
sqlcmdcommand prompt:1>. - If you get a connection failure, first attempt to diagnose the problem from the error message.
Create and query data
The following sections walk you through using sqlcmd to create a new database, add data, and run a basic query.
Create a new database
The following steps create a new database named TestDB.
- From the
sqlcmdcommand prompt, paste the following Transact-SQL command to create a test database: CREATE DATABASE TestDB;- On the next line, write a query to return the name of all of the databases on your server:
SELECT Name FROM sys.databases;- The previous two commands aren’t executed immediately. You must type
GOon a new line to execute the previous commands: GO
Insert data
Next create a new table, dbo.Inventory, and insert two new rows.
- From the
sqlcmdcommand prompt, switch context to the newTestDBdatabase: USE TestDB;- Create new table named
dbo.Inventory: CREATE TABLE dbo.Inventory ( id INT, name NVARCHAR (50), quantity INT, PRIMARY KEY (id) );- Insert data into the new table:
INSERT INTO dbo.Inventory VALUES (1, 'banana', 150); INSERT INTO dbo.Inventory VALUES (2, 'orange', 154);- Type
GOto execute the previous commands: GO
Select data
Now, run a query to return data from the dbo.Inventory table.
- From the
sqlcmdcommand prompt, enter a query that returns rows from thedbo.Inventorytable where the quantity is greater than 152 SELECT * FROM dbo.Inventory WHERE quantity > 152;- Execute the command:
GO
Exit the sqlcmd command prompt
To end your sqlcmd session, type QUIT:
SQL
QUIT
![]()