mssql
· 1.1 KiB · Text
Bruto
#Centos安装配置SqlServer
https://blog.csdn.net/weixin_43625238/article/details/141333125
#官方文档
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-red-hat?view=sql-server-linux-ver15&tabs=rhel8
#操作部分:
#下载SQL Server2019镜像
curl https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo > /etc/yum.repos.d/mssql-server.repo
#安装SqlServer程序包
yum install -y mssql-server
#按照提示安装SqlServer
/opt/mssql/bin/mssql-conf setup
#查看运行状态
systemctl status mssql-server
#开端口
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload
#安装mssql相关工具包(非必须)
#下载镜像
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo
#安装
yum install -y mssql-tools unixODBC-devel
#添加环境变量
echo 'export PATH=$PATH:/opt/mssql-tools/bin' >> /etc/profile
#重新加载环境变量
source /etc/profile
#本地连接测试
[root@hecs-166225 ~]# sqlcmd -S localhost -U sa -p
Password:
1>
1 | |
2 | #Centos安装配置SqlServer |
3 | https://blog.csdn.net/weixin_43625238/article/details/141333125 |
4 | |
5 | #官方文档 |
6 | https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-red-hat?view=sql-server-linux-ver15&tabs=rhel8 |
7 | |
8 | #操作部分: |
9 | |
10 | #下载SQL Server2019镜像 |
11 | curl https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo > /etc/yum.repos.d/mssql-server.repo |
12 | |
13 | #安装SqlServer程序包 |
14 | yum install -y mssql-server |
15 | |
16 | #按照提示安装SqlServer |
17 | /opt/mssql/bin/mssql-conf setup |
18 | |
19 | #查看运行状态 |
20 | systemctl status mssql-server |
21 | |
22 | #开端口 |
23 | sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent |
24 | |
25 | sudo firewall-cmd --reload |
26 | |
27 | |
28 | |
29 | #安装mssql相关工具包(非必须) |
30 | #下载镜像 |
31 | curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo |
32 | |
33 | #安装 |
34 | yum install -y mssql-tools unixODBC-devel |
35 | |
36 | #添加环境变量 |
37 | echo 'export PATH=$PATH:/opt/mssql-tools/bin' >> /etc/profile |
38 | |
39 | #重新加载环境变量 |
40 | source /etc/profile |
41 | |
42 | #本地连接测试 |
43 | [root@hecs-166225 ~]# sqlcmd -S localhost -U sa -p |
44 | Password: |
45 | 1> |
46 | |
47 | |
48 | |
49 | |
50 |