AWS

phpmyadmin(EC2) – RDS 연결

1. 개요

phpmyadmin으로 RDS의 DB에 접속하기

 

2. phpmyadmin 설치

sudo apt install phpmyadmin

 

3. phpmyadmin 접근 제어

sudo vi /etc/phpmyadmin/apache.conf

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    Order deny,allow   # 추가
    Deny from all         # 추가
    Allow from [IP]/32   # 추가

 

4. RDS 정보 입력

sudo vi /etc/phpmyadmin/config.inc.php ; Authentication type 위에 추가

$i++;
$cfg[‘Servers’][$i][‘host’]                 = ‘[RDS URL]‘;
$cfg[‘Servers’][$i][‘port’]                 = ‘[DB PORT]‘;
$cfg[‘Servers’][$i][‘socket’]             = ”;
$cfg[‘Servers’][$i][‘connect_type’]  = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’]        = ‘mysql’;
$cfg[‘Servers’][$i][‘compress’]        = ‘FALSE’;
$cfg[‘Servers’][$i][‘auth_type’]       = ‘config’;
$cfg[‘Servers’][$i][‘user’]                = ‘[DB USER]‘;
$cfg[‘Servers’][$i][‘password’]        = ‘[DB PASSWORD]‘;

 

5. apache 재시작

sudo service apache2 restart

Back To Top