Марат-блог
Услуги по продвижению и разработке сайта
Отправить заявку
Заказать обратный звонок

Спасибо, Ваша заявка принята.

В ближайшее время менеджер свяжется с Вами.

Главная » DEV » Connecting phpMyAdmin with AWS RDS MySQL Instance
Connecting phpMyAdmin with AWS RDS MySQL Instance
Программирование
450
19 февраля 2024

Connecting phpMyAdmin with AWS RDS MySQL Instance

This article explains how to install phpMyAdmin on Ubuntu 20.04 Server and connect the same with your AWS RDS MySQL instances. You can also use following method on any previous Ubuntu release.

Installing phpMyAdmin 

  1. Log in to Ubuntu server with root user using SSH client.
  2. Update the operating system with the latest packages.
    sudo apt-get update
  3. Install phpMyAdmin using the command
    sudo apt-get -y install phpmyadmin
  4. On the configuration screen, select the web server that should be automatically configured. In our case select Apache2 and then press “OK” and hit Enter.
 

The next screen which asks, “want to configure the database for phpMyAdmin with dbconfig-common?”. Select “Yes” and hit Enter.

On the next screen, enter the administrative MySQL root password and hit Enter.
 The final screen asks you to provide a password specifically for phpMyAdmin. This password will be used to log in. After selecting a password, hit Enter to continue.
 

Configuring Apache 2 & phpMyAdmin

 
  1. Once phpMyAdmin is installed, configure the apache.conf file by adding following line to the bottom.
    sudo vi /etc/apache2/apache2.conf
    The lines you will need to add are:
    # phpMyAdmin Configuration
    Include /etc/phpmyadmin/apache.conf
  2. Edit the configuration file for phpMyAdmin. Add AWS RDS endpoint and other server configurations
    Sudo vi /etc/phpMyAdmin/config.inc.php
 
$i++;
$cfg['Servers'][$i]['host'] = 'RDS MYSQL ENDPOINT';//Enter IP address or hostname
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli'; // Extension to connect to the database.
$cfg['Servers'][$i]['port'] = ''; //The port number of MySQL service $cfg['Servers'][$i]['user'] = ''; // Username to connect
$cfg['Servers'][$i]['password'] = ''; //Password associated with the username
 
 
  1. Restart the apache service
    sudo service apache2 restart
 

RDS Security Group

In RDS Security group open inbound port 3306 to give phpMyAdmin access to MySQL. You can give which IP address of the server where phpMyAdmin is installed in the Security group.

Now log in to phpMyAdmin using the password you created by visiting the URL: https:///phpmyadmin.