How to install and configure SQL Server in Centos 7.3

Source: Internet
Author: User
Tags mssql server

How to install and configure SQL Server in Centos 7.3

In the future, I will deal with Linux. I am lucky to be a loyal fan of. net in Linux, because. net core and asp.net core are already cross-platform. Today, it's okay to try the legendary Linux SQL server.

Install SQL Server to Centos 7.3

Official documents: https://docs.microsoft.com/en-us/ SQL /linux/quickstart-install-connect-red-hat

OS prerequisites:

cat /etc/redhat-release

1. Set the yum installation Source

curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo

2. Install Mssql server

yum install -y mssql-server

3. view the version and installation path

rpm -qa | grep mssql

find / -name mssql

4. Configure an SQL server account

cd /opt/mssql/bin

./mssql.conf setup 

(Mssql-server must be stopped for configuration)

Start the service

systemctl start mssql-serversystemctl enable mssql-server

5. Set firewall

firewall-cmd --add-port='1433/tcp' --permanentfirewall-cmd –reload

Install the command line management tool

1. Install the local client command line tool

curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repoyum install -y mssql-tools

2. Configure SqlCmd Environment Variables

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

3. view the database status

systemctl status mssql-server

If the startup fails, view the log information:

Journalctl-u mssql-server.service-B

4. Connect to the database

sqlcmd -S localhost -U SA -P ''

5. Create and query Databases

CREATE DATABASE DataTest;GOSELECT Name from sys.Databases;GO

6. General Database Operations (create tables, insert data, and query data)

Summary

The installation steps are similar to those in the official documentation. It is easy to get started and install.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.