This page explains how to install and configure MySQL and phpMyAdmin on a freshly AWS EC2 Cloud9 environement with the following versions:
Reading the following pages is recommended before installing MySQL and phpMyAdmin:
The following assumes that Apache is installed and properly configured.
AWS Cloud9 environements come with MySQL already installed. Launch a terminal (Alt-T), and run the following command:
sudo service mysql status
MySQL is active and running:
MySQL is installed with a root user. It is not safe to work with this user. Let's create a new MySQL user. First log in MySQL with the root user (no password):
sudo mysql -u root
Create the new user (replace username
and password
by the expected values):
mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
Then, grant your new user the appropriate privileges:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
Exit MySQL prompt :
mysql> exit
You can check that you new user is created by log-in in MySQL (exit
to quit MySQL prompt):
mysql -u username -p
Install phpMyAdmin with the following command:
sudo apt install phpmyadmin php-mbstring php-gettext
You'll be asked several questions while installing phpMyAdmin:
Tab
key to move in the menu ;Space
key to select ;Enter
key to validate.First, select Apache2 as web server:
Click yes to configure database with dbconfig-common:
Enter and confirme your phpMyAdmin password:
Once installation is over, click on Preview Running Application and add /phpmyadmin/ at the end of the URL.
If phpMyAdmin is not working properly, try one of the following:
/phpmyadmin/index.php
instead of /phpmyadmin/
Once you get the following page, login with the MySQL username and password created previously:
Et voilà !