CentOS 7安裝SQL Server

來源:互聯網
上載者:User

標籤:linux   sql   centos   

在我們的傳統理解中認為SQL是只能安裝在Windows系統中的,但如今微軟也開始擁抱Linux,出現了SQL For Linux的版本,雖然目前是技術預覽版,但在不久的將來會出現正式商用的正式版的。那今天我就帶著大家來安裝一次,在這裡我選擇的系統是CentOS 7,在於我這樣一個常年玩Windows和非常熟悉Windows的人來說需要用CentOS的全命令還是很菜鳥的,因此還請各位Linux大神多多包涵。本人以最傻瓜的方式帶著大家一步一步從系統到SQL的安裝都走一遍,相信未來對有該需求的使用者來說是非常有協助的。

那麼言歸正傳,這裡我用VMwareWorkstation建立好了一個1vCPU,3G記憶體,20G硬碟的虛擬機器,放入CentOS7的光碟片開始安裝系統。

選擇安裝CentOS7

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKioL1lDTrigAFQiAABg3aFbfg4699.png" height="467" />

等待一堆檢測開始跑

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/99/0A/wKiom1lDTrnz-vdJAAFxMEC9_NQ828.png" height="443" />

在這裡選擇安裝語言,點擊繼續

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/99/0A/wKioL1lDTrrTjW7PAAG2j3FjBPo541.png" height="484" />

下面這個部份預設即可

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/99/0A/wKioL1lDTrvQfg8yAAHwfXChTjE555.png" height="484" />

下面的這個位置需要設定下

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKiom1lDTrzRwjl2AACXaRuk-B8215.png" height="207" />

安裝位置就是選擇我們的硬碟,這裡我選擇所有空間,KDUMP我也不需要排錯什麼的,網路和主機名稱設定好固定IP地址和主機名稱

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKioL1lDTr3j1JFQAAFwPVLb_Iw609.png" height="482" />

設定完成後點擊“完成”後就可以開始安裝了

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/99/0A/wKioL1lDTr_xyE_BAAHp5Nrze94901.png" height="484" />

安裝期間只需要設定root密碼即可

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/99/0A/wKiom1lDTsLw1IQRAAL8Q7ilkqY903.png" height="484" />

剩下的等待安裝完成

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/99/0A/wKiom1lDTsWgckePAALdFKkpl3Q814.png" height="483" />

安裝完成,重啟

650) this.width=650;" title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKiom1lDTseAOEojAAGOc50mZXw124.png" height="483" />    
安裝完成後,CentOS需要訪問互連網,使用網路安裝,採用root使用者登入,如果不是root使用者,需要sudo運行。

在安裝SQL之前大家需要瞭解這個網站https://packages.microsoft.com,在這個網站中存放了各個Linux分支版本對應的SQL設定檔以及安裝檔案,待會我就會調用這裡下載安裝,當然如果您不能訪問互連網可以提前下載好這些檔案進行離線安裝也是可以了。

CentOS啟動很快,沒有安裝GUI的組件,自然就屬於敲命令的裝逼時間了

650) this.width=650;" title="clip_image001" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image001" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKioL1lDTsfCWmqGAAAvpORSS-w762.png" height="83" />

輸入curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo斷行符號後開始下載相關設定檔了

650) this.width=650;" title="clip_image002" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKioL1lDTsnjtGXcAAEDukaQZV0515.png" height="338" />

650) this.width=650;" title="clip_image003" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image003" src="http://s3.51cto.com/wyfs02/M00/99/0A/wKioL1lDTsqh10RrAABmZWk5OhU472.png" height="99" />

下載完成且安裝SQL完成

650) this.width=650;" title="clip_image004" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image004" src="http://s3.51cto.com/wyfs02/M01/99/0A/wKioL1lDTsuhQElwAADwFgzeN2s560.png" height="337" />

等待下載完成,下載完成後是配置SQL了sudo /opt/mssql/bin/mssql-conf setup

並設定SQL的sa帳戶密碼了,輸入sa是不會顯示的,因此屬於盲打(不要在乎這些細節啦)

650) this.width=650;" title="clip_image005" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image005" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKioL1lDTszjecY4AAB6WkIQi78394.png" height="133" />

然後告訴您這個是評估版本,還有147天評估期

650) this.width=650;" title="clip_image006" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image006" src="http://s3.51cto.com/wyfs02/M01/99/0A/wKioL1lDTs2iWH04AAA6_EzS6YQ567.png" height="63" />

到這裡我們的SQL主程式就安裝完成了

我們可以來看看SQL的服務的狀態

systemctl status mssql-server

650) this.width=650;" title="clip_image007" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image007" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKioL1lDTs6RzdEXAAEVptPTtU8053.png" height="208" />

接下來如果我們需要從其他電腦使用該CentOS的SQL那麼需要開下該CentOSSQL主機的防火牆連接埠1433了

sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent  
sudo firewall-cmd --reload

650) this.width=650;" title="clip_image008" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image008" src="http://s3.51cto.com/wyfs02/M02/99/0A/wKiom1lDTs-iR-AAAAA2etW7Kog115.png" height="72" />

如果要升級SQL軟體包,請執行

sudo yum update mssql-server

這些命令將下載最新的軟體包並替換/opt/mssql/下面的二進位檔案。使用者產生的資料庫和系統資料庫不受此操作的影響。

650) this.width=650;" title="clip_image009" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px;" border="0" alt="clip_image009" src="http://s3.51cto.com/wyfs02/M01/99/0A/wKiom1lDTtDi5iuwAABlWs3lXXY753.png" height="129" />

本文出自 “ZJUNSEN的雲端運算” 部落格,請務必保留此出處http://rdsrv.blog.51cto.com/2996778/1937388

CentOS 7安裝SQL Server

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.