LoginSignup
1
1

More than 1 year has passed since last update.

AWS ほぼコピペでできる phpMyAdmin入れ方!!

Last updated at Posted at 2021-05-07

ターミナルから操作するLinuxコマンド一覧
個人で設定されているものが入る場合は赤文字
<システムの更新>
$sudo yum update
MySQLをインストール
$sudo yum install mysql
ここから
MySQLへの接続確認
$mysql -u admin -p -h MySQLDBのエンドポイント
RDSで設定した
-h の後 エンドポイント
-u の後 ユーザーID 僕の場合admin
コマンド入力後RDSで設定したパスワードがもとめられる求められる
ここまで
>quit

$sudo yum install httpd
$sudo systemctl enable httpd
$sudo systemctl start httpd

(httpが正常に稼働しているかブラウザで確認)
$sudo amazon-linux-extras enable php7.4
$sudo amazon-linux-extras install php7.4
$sudo yum install php-mbstring php-xml
$sudo systemctl enable php-fpm
$sudo systemctl start php-fpm
$sudo systemctl restart httpd
$sudo nano /var/www/html/index.php

(phpが正常に稼働しているかブラウザで確認)

$cd /var/www/html

$sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

$sudo mkdir phpMyAdmin

$sudo tar -xvzf phpMyAdmin-latest-all-languages.tar.gz -C phpMyAdmin --strip-components 1

$sudo rm phpMyAdmin-latest-all-languages.tar.gz
$sudo cp phpMyAdmin/config.sample.inc.php phpMyAdmin/config.inc.php

$sudo nano phpMyAdmin/config.inc.php
(ファイルから下記の内容を探し、修正)

ここから
$cfg['Servers'][$i]['host'] = 'localhost';
↑を↓に修正
$cfg['Servers'][$i]['host'] = '先程と同じエンドポイント';

ここまで
(phpMyAdminが正常に稼働しているかブラウザで確認)

AWSインスタンスからパブリック IPv4 DNS オープンアドレスに
http://元々のアドレス/phpMyAdmin/

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1