您当前的位置:首页 > 计算机 > 系统应用 > Linux

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

时间:11-21来源:作者:点击数:

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

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 --permanentsudo 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.
    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:
    sudo rm -rf /var/opt/mssql/
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
    无相关信息
栏目更新
栏目热门