centos7部署SqlServer2019的實(shí)現(xiàn)步驟
一 關(guān)于SQL Server
SQL Server數(shù)據(jù)庫是Microsoft開發(fā)設(shè)計(jì)的一個(gè)關(guān)系數(shù)據(jù)庫智能管理系統(tǒng)(RDBMS)。

二 安裝部署

2.1 安裝依賴 Python3
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz tar -xvf Python-3.6.6.tar.xz cd Python-3.6.6 ./configure --prefix=/home/app/Python-3.6.6 make && make install ln -s /home/app/Python-3.6.6/bin/python3.6 /usr/bin/python3
2.2 安裝mssql-server-2019
2.2.1 安裝mssql-server
wget -O /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo yum install -y mssql-server
2.2.2 配置安裝信息
在指定位置輸入要安裝的版本號(hào)和管理員賬號(hào)SA的密碼:
[root@test66 server2019]# /opt/mssql/bin/mssql-conf setup Choose an edition of SQL Server: #仔細(xì)閱讀每個(gè)版本的說明,選擇適合自己的而版本,這里選擇安裝 3)Express (free) 1) Evaluation (free, no production use rights, 180-day limit) 2) Developer (free, no production use rights) 3) Express (free) 4) Web (PAID) 5) Standard (PAID) 6) Enterprise (PAID) - CPU Core utilization restricted to 20 physical/40 hyperthreaded 7) Enterprise Core (PAID) - CPU Core utilization up to Operating System Maximum 8) I bought a license through a retail sales channel and have a product key to enter. Details about editions can be found at https://go.microsoft.com/fwlink/?LinkId=2109348&clcid=0x409 Use of PAID editions of this software requires separate licensing through a Microsoft Volume Licensing program. By choosing a PAID edition, you are verifying that you have the appropriate number of licenses in place to install and run this software. Enter your edition(1-8): 3 ##輸入上邊自己要安裝的版本對(duì)應(yīng)的數(shù)字 The license terms for this product can be found in /usr/share/doc/mssql-server or downloaded from: https://go.microsoft.com/fwlink/?LinkId=2104294&clcid=0x409 The privacy statement can be viewed at: https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409 Enter the SQL Server system administrator password: #輸入管理員賬號(hào)SA的密碼,密碼長度八位以上,且密碼必須包含數(shù)字、字母和特殊字符 Confirm the SQL Server system administrator password: #確認(rèn)密碼 Configuring SQL Server... The licensing PID was successfully processed. The new edition is [Express Edition]. ForceFlush is enabled for this instance. ForceFlush feature is enabled for log durability. Setup has completed successfully. SQL Server is now starting.
2.2.3 檢查啟動(dòng)狀態(tài):
systemctl status mssql-server
查看啟動(dòng)端口

三 安裝命令行工具
3.1 卸載服務(wù)器上老版本unixODBC-utf16-devel (如有)
yum remove unixODBC-utf16 unixODBC-utf16-devel
3.2 安裝unixODBC-devel
wget -O /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
yum安裝,兩處交互信息都輸入YES
[root@test66 tools]# yum install -y mssql-tools unixODBC-devel ....... #省略若干行 Warning: RPMDB altered outside of yum. Installing : unixODBC-2.3.7-1.rh.x86_64 1/4 The license terms for this product can be downloaded from https://aka.ms/odbc17eula and found in /usr/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES', you indicate that you accept the license terms. Do you accept the license terms? (Enter YES or NO) YES #輸入YES Installing : msodbcsql17-17.9.1.1-1.x86_64 2/4 The license terms for this product can be downloaded from http://go.microsoft.com/fwlink/?LinkId=746949 and found in /usr/share/doc/mssql-tools/LICENSE.txt . By entering 'YES', you indicate that you accept the license terms. Do you accept the license terms? (Enter YES or NO) YES #輸入YES Installing : mssql-tools-17.9.1.1-1.x86_64 3/4 Installing : unixODBC-devel-2.3.7-1.rh.x86_64 4/4 Verifying : unixODBC-2.3.7-1.rh.x86_64 1/4 Verifying : unixODBC-devel-2.3.7-1.rh.x86_64 2/4 Verifying : msodbcsql17-17.9.1.1-1.x86_64 3/4 Verifying : mssql-tools-17.9.1.1-1.x86_64 4/4 Installed: mssql-tools.x86_64 0:17.9.1.1-1 unixODBC-devel.x86_64 0:2.3.7-1.rh Dependency Installed: msodbcsql17.x86_64 0:17.9.1.1-1 unixODBC.x86_64 0:2.3.7-1.rh
3.3 設(shè)置環(huán)境變量
echo "export PATH=$PATH:/opt/mssql-tools/bin" >> /etc/profile source /etc/profile
四 驗(yàn)證數(shù)據(jù)庫
4.1 登錄數(shù)據(jù)庫
[root@test66 tools]# sqlcmd -S localhost -U SA -p Password: 1>

4.2 創(chuàng)建測試庫
1> CREATE DATABASE [SRE] 2> GO

4.3 查看所有database
1> SELECT [NAME] FROM SYS.DATABASES 2> GO

4.4 刪除數(shù)據(jù)庫
1> DROP DATABASE SRE 2> GO

到此這篇關(guān)于centos7部署SqlServer2019的實(shí)現(xiàn)步驟的文章就介紹到這了,更多相關(guān)centos7部署SqlServer2019內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
與 SQL Server 建立連接時(shí)出現(xiàn)與網(wǎng)絡(luò)相關(guān)的或特定于實(shí)例的錯(cuò)誤
與 SQL Server 建立連接時(shí)出現(xiàn)與網(wǎng)絡(luò)相關(guān)的或特定于實(shí)例的錯(cuò)誤,未找到或無法訪問服務(wù)器,請(qǐng)驗(yàn)證實(shí)例名稱是否正確并且 SQL Server 已配置為允許遠(yuǎn)程連接2024-04-04
一個(gè)基于ROW_NUMBER()的通用分頁存儲(chǔ)過程代碼
項(xiàng)目中有很多小型的表(數(shù)據(jù)量不大),都需要實(shí)現(xiàn)分頁查詢,因此實(shí)現(xiàn)了一個(gè)通用的分頁。2010-10-10
教你恢復(fù)SQLSERVER的master系統(tǒng)庫的方法
這篇文章主要介紹了恢復(fù)SQLSERVER的master系統(tǒng)庫,本文介紹可能需要恢復(fù)master數(shù)據(jù)庫的情況以及如何正確完成這些步驟,需要的朋友可以參考下2022-09-09
sql not in 與not exists使用中的細(xì)微差別
用的時(shí)候我們只注重查詢的效率,但卻往往會(huì)忽略一下比較細(xì)小的區(qū)別2013-02-02
SQL Server 定時(shí)訪問url激活數(shù)據(jù)同步示例
這篇文章主要介紹的是SQL Server 定時(shí)訪問url激活數(shù)據(jù)同步的具體實(shí)現(xiàn),需要的朋友可以參考下2014-05-05
將所有符合條件的結(jié)果拼接成一列并用逗號(hào)隔開的一個(gè)sql語句
把所有符合條件的結(jié)果拼接成一列,用逗號(hào)隔開的一個(gè)sql語句。2010-06-06
SQL中Join關(guān)聯(lián)類型及實(shí)戰(zhàn)案例小結(jié)
在SQL查詢中,Join用于將兩個(gè)或多個(gè)表中的記錄根據(jù)關(guān)聯(lián)字段組合起來,是關(guān)系型數(shù)據(jù)庫中數(shù)據(jù)查詢的核心操作之一,本文給大家介紹SQL中Join關(guān)聯(lián)類型及實(shí)戰(zhàn)案例,感興趣的朋友跟隨小編一起看看吧2025-09-09

