Linux CentOS 7 安装 微软SQL数据库 Microsoft SQL Server

Linux CentOS 7 安装 微软SQL数据库 Microsoft SQL Server

yum clean all
yum -y update
wget https://packages.microsoft.com/config/rhel/7/mssql-server.repo
wget https://packages.microsoft.com/config/rhel/7/prod.repo
mv *.repo /etc/yum.repos.d/mssql.repo
# 安装
yum install -y mssql-server mssql-tools

# 配置
/opt/mssql/bin/sqlservr-setup

Microsoft(R) SQL Server(R) Setup

You can abort setup at anytime by pressing Ctrl-C. Start this program
with the --help option for information about running it in unattended
mode.

The license terms for this product can be downloaded from
http://go.microsoft.com/fwlink/?LinkId=746388 and found
in /usr/share/doc/mssql-server/LICENSE.TXT.

Do you accept the license terms? If so, please type "YES": YES

Please enter a password for the system administrator (SA) account: Enter Admin Password
Please confirm the password for the system administrator (SA) account: Re Enter Admin Password

Setting system administrator (SA) account password...

Do you wish to start the SQL Server service now? [y/n]: n

You can use sqlservr-setup --start-service to start SQL Server, and
sqlservr-setup --enable-service to enable SQL Server to start at boot.

Setup completed successfully.

Finally, Start the MS SQL Service:

# 启动数据库
systemctl start mssql-server
systemctl enable mssql-server

# 开启防火墙
firewall-cmd --permanent --zone=public --add-port=1433/tcp
firewall-cmd --reload

# 安装完成 连接数据库
sqlcmd -H 127.0.0.1 -U sa
Password: 
1>

One thought on “Linux CentOS 7 安装 微软SQL数据库 Microsoft SQL Server

  1. yum

    求教,以前安装了sqlserver,卸载后,在此安装,启动失败,是不是卸载的不彻底。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注