1. 程式人生 > >在Oracle Linux 7上通過官方Repo在線安裝SQL Server 2017

在Oracle Linux 7上通過官方Repo在線安裝SQL Server 2017

驗證 sco 語句 serve sys wall roc mark sqlcmd

掛載數據盤

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

#vgdispaly的Total PE

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片


安裝SQL Server服務端

1.下載SQL Server Red Hat Repository配置文件:

curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

技術分享圖片


2.安裝SQL Server實例

yum install -y mssql-server

技術分享圖片


3.運行mssql-conf setup按照提示配置,選擇版本、設置SA密碼。

/opt/mssql/bin/mssql-conf setup

技術分享圖片


4.驗證服務是否正常運行:

systemctl status mssql-server

技術分享圖片


5.禁用firewalld

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld

技術分享圖片


6.禁用selinux

getenforce
setenforce 0
vi /etc/sysconfig/selinux

修改SELINUX值為disabled

技術分享圖片


安裝SQL Server命令行工具

若要創建數據庫時,需要使用一種工具,可以在 SQL Server 上運行的 Transact SQL 語句進行連接。 以下是 SQL Server 命令行工具: sqlcmd和bcp。


1.下載Red Hat Repo配置文件。

curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo


2.卸載舊版的unixODBC包。

yum remove unixODBC-utf16 unixODBC-utf16-devel


3.安裝命令行工具

yum install -y mssql-tools unixODBC-devel


4.將/opt/mssql-tools/bin/添加到PATH環境變量。

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc


本地連接

技術分享圖片

在Oracle Linux 7上通過官方Repo在線安裝SQL Server 2017