在Red Hat Enterprise Linux或CentOS中安装SQL Server

本文基于微软官方文档建立,原文地址:

https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-setup-red-hat

本文提供了在Red Hat Enterprise Linux (RHEL)系统中安装SQL Server vNext CTP 1.3的完整攻略。

注意

你需要至少3.25GB的内存来运行SQL Server的Linux版。 SQL Server引擎此次测试了最高1 TB内存。

安装 SQL Server

To install the mssql-server package on RHEL, follow these steps:

  1. Enter superuser mode.
    sudo su
    
  2. Download the Microsoft SQL Server Red Hat repository configuration file:
    curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo
    
  3. Exit superuser mode.
    exit
    
  4. Run the following commands to install SQL Server:
    sudo yum install -y mssql-server
    
  5. 安装完毕后,运行mssql-conf setup命令,按照出现的提示操作。请务必为超级管理员账户(SA)指定一个强密码(至少8位字符,包含大写和小写字母,数字和/或符号)。
    sudo /opt/mssql/bin/mssql-conf setup
    
  6. 当配置完成后,请确认服务已经运行:
    systemctl status mssql-server
    
  7. 如果允许远程连接,要在RHEL(CentOS)的防火墙开启SQL Server的端口。默认为1433。如果你的防火墙使用FirewallD。则可以使用以下命令:
  8. sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
    sudo firewall-cmd --reload
    

更新SQL Server

To upgrade the mssql-server package on RHEL, execute the following command:

   sudo yum update mssql-server

 

These commands will download the newest package and replace the binaries located under /opt/mssql/. The user generated databases and system databases will not be affected by this operation.

卸载SQL Server

To remove the mssql-server package on RHEL, follow these steps:

  1. Run the remove command. This will delete the package and remove the files under /opt/mssql/. However, this command will not affect user-generated and system database files, which are located under /var/opt/mssql.

    Copy

    bash

    sudo yum remove mssql-server
    
  2. Removing the package will not delete the generated database files. If you want to delete the database files use the following command:

    Copy

    bash

    sudo rm -rf /var/opt/mssql/
    

转载于:https://my.oschina.net/chipo/blog/841484

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值