![ナマケモノ君](https://rin-tech.blog/wp-content/uploads/2023/08/ナマケモノ-はてな.png)
MicrosoftのSQL Serverのインストールする方法ってどうやるのかな?
設定方法も分からないや。
そうだ!ふくろう先生に聞いてみよう。
![ナマケモノ君](https://rin-tech.blog/wp-content/uploads/2023/08/ナマケモノ-はてな.png)
ふくろう先生。こんにちは。
MicrosoftのSQL Serverをインストールする方法ってどうやればいいですか?
設定方法も分からないので教えて下さい。
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
ナマケモノ君。こんにちは!
今回は、MicrosoftのSQL Serverをインストール方法と環境設定だね。
わかったよ。
次の手順に従っていけば、出来るよ。
今回の最終目標
- MicrosoftのSQL Serverのインストールを完了させて標準的な設定を行います。
用意するもの
- CentOS7 がインストールされているPC(Server)を1台。
概要
- MicrosoftのSQL Serverをインストールします。
- インストールしたMicrosoftのSQL Serverの初期設定を行います。
作業手順
CentOS バージョン7のインストールが、まだの方はこちらを参照して下さい。
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.1
まず、スーパーユーザーに変更します。
su –
![01.スーパーユーザー](https://rin-tech.blog/wp-content/uploads/2023/09/01.スーパーユーザー-2.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.2
パスワードを聞いてくるのでスーパーユーザーのパスワードを入力してね。
![02.パスワード](https://rin-tech.blog/wp-content/uploads/2023/09/02.パスワード.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.3
curlを使用してMicrosoft Red Hat リポジトリ構成ファイルをダウンロードするよ。
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
![03.curl](https://rin-tech.blog/wp-content/uploads/2023/09/03.curl_-1024x29.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.4
リポジトリのダウンロードが完了すると下記画面のように表示されるよ。
![04.curl 完了](https://rin-tech.blog/wp-content/uploads/2023/09/04.curl-完了.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.5
mssql-server をインストールするよ。
yum install -y mssql-server
![05.mssql-serverインストール](https://rin-tech.blog/wp-content/uploads/2023/09/05.mssql-serverインストール.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.6
mssql-serverのインストールが完了すると、下記画面のような内容が表示されるよ。
![06.mssql-serverインストール 完了](https://rin-tech.blog/wp-content/uploads/2023/09/06.mssql-serverインストール-完了-1024x575.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.7
次にmssql-serverのセットアップに移るよ。
/opt/mssql/bin/mssql-conf setup
![07.mssql-serverセットアップ](https://rin-tech.blog/wp-content/uploads/2023/09/07.mssql-serverセットアップ.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.8
エディションをきかくれるので、今回は『3)Express(無料)』を選択するよ。
![08.エディションの選択](https://rin-tech.blog/wp-content/uploads/2023/09/08.エディションの選択-1024x342.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.9
ライセンス条項の同意を求められるので『Yes』を入力してね。
![09.ライセンス条項](https://rin-tech.blog/wp-content/uploads/2023/09/09.ライセンス条項.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.10
使用する言語を聞いてくるので、もちろん『(6)日本語』を選択するよ。
![10.言語の選択](https://rin-tech.blog/wp-content/uploads/2023/09/10.言語の選択.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.11
管理者パスワードの設定するので任意のパスワードを入力してね。
![11.管理者パスワード](https://rin-tech.blog/wp-content/uploads/2023/09/11.管理者パスワード.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.12
先程入力した管理者パスワードを再度入力してね。
![12.管理者確認パスワード](https://rin-tech.blog/wp-content/uploads/2023/09/12.管理者確認パスワード.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.13
画面が移って、サーバーの構成がはじまるよ。
![13.サーバーを構成](https://rin-tech.blog/wp-content/uploads/2023/09/13.サーバーを構成.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.14
下記の画面のように『セットアップは正常に完了しました。SQLServerを起動します。』と移っていきます。
![14.サーバーを構成 完了](https://rin-tech.blog/wp-content/uploads/2023/09/14.サーバーを構成-完了-1024x63.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.15
ステータスの表示させます。
systemctl status mssql-server
![15.ステータス](https://rin-tech.blog/wp-content/uploads/2023/09/15.ステータス.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.16
下記のようなステータス画面が表示されれば大丈夫です。
![16.ステータス 画面](https://rin-tech.blog/wp-content/uploads/2023/09/16.ステータス-画面-1024x294.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.17
次は、ファイヤーウォールの設定を行うよ。
firewall-cmd –zone=public –add-port=1433/tcp –permanent
![17.ファイヤーウォールの設定](https://rin-tech.blog/wp-content/uploads/2023/09/17.ファイヤーウォールの設定.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.18
ファイヤーウォールの設定が完了すると『SUCCESS』が表示されるよ。
![18ファイヤーウォールの完了](https://rin-tech.blog/wp-content/uploads/2023/09/18ファイヤーウォールの完了.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.19
先程設定した内容を再度読み込むためにリロードコマンドを実行。
firewall-cmd –reload
![19ファイヤーウォールのリロード](https://rin-tech.blog/wp-content/uploads/2023/09/19ファイヤーウォールのリロード.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.20
ファイヤーウォールのリロードが完了すると『SUCCESS』が表示されるよ。
![20ファイヤーウォールのリロードの完了](https://rin-tech.blog/wp-content/uploads/2023/09/20ファイヤーウォールのリロードの完了.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.21
Microsoft Red Hat リポジトリ構成ファイルをダウンロードするよ。今度は、コマンドライン用のツールだよ。
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/prod.repo
![21.レポジトリ](https://rin-tech.blog/wp-content/uploads/2023/09/21.レポジトリ.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.22
Microsoft Red Hat リポジトリ構成ファイルのダウンロードが完了すると、下記画面が表示されるよ。
![22.レポジトリの完了](https://rin-tech.blog/wp-content/uploads/2023/09/22.レポジトリの完了.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.23
前のODBCをリムーブするよ。
yum remove unixODBC-utf16 unixODBC-utf16-devel
![23.ODBCのリムーブ](https://rin-tech.blog/wp-content/uploads/2023/09/23.ODBCのリムーブ.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.24
今回こちらの環境でが削除対象は無かったようです。
![24.ODBCのリムーブ 完了](https://rin-tech.blog/wp-content/uploads/2023/09/24.ODBCのリムーブ-完了.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.25
新しいODBCをインストールするよ。
yum install -y mssql-tools unixODBC-devel
![25.ODBCのインストール](https://rin-tech.blog/wp-content/uploads/2023/09/25.ODBCのインストール.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.26
ライセンス状況の確認画面が表示されるので『Yes』を押下してね。
![26.ライセンスの確認](https://rin-tech.blog/wp-content/uploads/2023/09/26.ライセンスの確認.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.27
もう一つのライセンス条項も同じように対応してね。
![27.ライセンスの確認](https://rin-tech.blog/wp-content/uploads/2023/09/27.ライセンスの確認.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.28
『完了しました!』でODBCのインストールは完了です。
![28.ODBCのインストール 完了](https://rin-tech.blog/wp-content/uploads/2023/09/28.ODBCのインストール-完了.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.29
パスの設定を2つ行います。
まず最初のパスです。
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bash_profile
![29.パスの設定](https://rin-tech.blog/wp-content/uploads/2023/09/29.パスの設定.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.30
次のパスの設定です。
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bashrc
![30.パスの設定](https://rin-tech.blog/wp-content/uploads/2023/09/30.パスの設定.png)
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
step.31
最後にシェルを実行して終了です。
source ~/.bashrc
![31.シェルの実行](https://rin-tech.blog/wp-content/uploads/2023/09/31.シェルの実行.png)
Complete!!
![ふくろう先生](https://rin-tech.blog/wp-content/uploads/2023/08/ふくろう先生.png)
お疲れ様でした。
これで晴れてMicrosoftのSQL Serverのインストール及び環境設定は完了です。
ナマケモノ君。出来たかな?
![ナマケモノ君](https://rin-tech.blog/wp-content/uploads/2023/08/ナマケモノ-喜ぶ.png)
はい!。出来ました。
ふくろう先生、ありがとうございました。
コメント