Install SQL Server, Centos 7.3

Source: Internet
Author: User
Tags mssql server

Install SQL Server in Centos 7.3, Centos

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:

   
Memory 3.25 GB
File System XFSOrEXT4(Other file systems, suchBTRFS, Are unsupported)
Disk space 6 GB
Processor speed 2 GHz
Processor cores 2 cores
Processor type X64-compatible only
 
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 (you must stop Mssql-server to configure it)

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.repo
yum install -y mssql-tools

2. Configure SqlCmd Environment Variables

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo '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 a database

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.

Related Article

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.