2020年04月10日
このエントリーをはてなブックマークに追加
以下の環境です。
Webサーバー+DBサーバー

これらのサーバーは、 eth2 を利用して 192.168.0.X のセグメントに所属しています。
今回は Webサーバーに phpmyadmin のファイルを設置し、そこからDBサーバーをコントロールします。

phpmyadmin のダウンロードとか unzip などは割愛。

※適切にディレクトリを移動したあとで以下のコマンド
# cp -p config.sample.inc.php config.inc.php
# vi config.inc.php

$cfg['blowfish_secret'] を設定します。適当な文字列です。

DBサーバーのIPアドレスを指定します。
$cfg['Servers'][$i]['host'] = '192.168.0.X;
とりあえずこれで動作可能となりました。

DBサーバーでは外部からアクセスがあるので、以下の通り設定を行います。

※すでにパスワードは設定されています。
mysql -u root -p
[パスワード入力]
grant all privileges on *.* to root@"192.168.0.%" identified by 'パスワード' with grant option;

上記コマンドはすべてのデータベースに対して、192.168.0.X サーバーから root でのログインを許可するものです。

そのほか firewall を設定します。
※ eth2 が所属している zone が internal です。
# firewall-cmd --add-service=mysql --zone=internal --permanent
# firewall-cmd --list-services --zone=internal --permanent
mysql ssh

# firewall-cmd --reload

これでアクセスができるようになりました。


stock_value at 14:30│Comments(0)技術 

この記事にコメントする

名前:
URL:
  情報を記憶: 評価: 顔