PHPMYAdmin is not a substitute for MYSQL but enables users to directly interact with MySQL through a web interface to easily perform MySQL operations.
Though millions use phpMyAdmin, it has some security issues. In this lesson we will discuss how to install phpMyAdmin, and point you to instructions on how to secure the phpMyAdmin so that you can safely use it to manage your databases from an Ubuntu-Linux 16.04 operating system.
We assume that you've completed a LAMP (Linux, Apache, MySQL, and PHP) installation on your Ubuntu 16.04 server. If you have not done so, go to
How to Install Full LAMP Stack on Ubuntu Linux Desktop
LAMP stack is a group of open source software, namely; Linux, Apache, MySQL, and PHP, used to get web servers up and running. The LAMP virtual private server is already running...Before we proceed, there are important security considerations when using software like phpMyAdmin that you need to take into account, since it:
- Communicates directly with your MySQL installation.
- Handles authentication using MySQL credentials.
- Executes and returns results for arbitrary SQL queries.
Once you are finished with the above requirements, you're ready to get started with the installation process.
Install phpMyAdmin
Update the local package index:
Code: Select all
sudo apt-get update
Code: Select all
sudo apt-get install phpmyadmin php-mbstring php-gettext
Attention: When the first prompt appears, apache2 is highlighted, but not selected. Hit Space, Tab, and then Enter to select Apache.
- For the server selection, choose apache2.
- Select yes when asked whether to use dbconfig-common to set up the database
- You will be prompted for your database administrator's password (the same password you use for MYSQL)
- You will then be asked to choose and confirm a password for the phpMyAdmin application itself
The next thing we need to do is explicitly enable the PHP mcrypt and mbstring extensions, by executing:
Code: Select all
sudo phpenmod mcrypt
sudo phpenmod mbstring
Code: Select all
Error:
WARNING: Module mcrypt ini file doesn't exist under /etc/php/7.2/mods-available
Module mbstring ini file doesn't exist under /etc/php/7.2/mods-available
Code: Select all
WARNING: Module mcrypt ini file doesn't exist under /etc/php/5.6/mods-available
Module mbstring ini file doesn't exist under /etc/php/7.2/mods-available
You can respectively fix the above errors by executing these commands:
Code: Select all
sudo apt install php7.2-mcrypt && sudo apt install php7.2-mbstring
sudo apt install php5.6-mcrypt && sudo apt install php5.6-mbstring
Code: Select all
sudo a2enmod mcrypt
sudo a2enmod mbstring

phpenmod mcrypt and phpenmod mbstring return errors
I use a minimal server environment of ubuntu16.04.1, Apache2, MySQL and PHP 7.0.8.1. I've installem AMP via: apt-get install lamp-server^. I also installed PHPmyadmin manually via: cd /var/www/htmlThen, restart Apache for the changes to be effected:
Code: Select all
sudo systemctl restart apache2
Code: Select all
https://domain_name_or_IP/phpmyadmin
Code: Select all
http://localhost/phpmyadmin
Once you log in, you will be taken to the phpMyAdmin Dashboard.
You can now use phpMyAdmin for development in your local machine, but for production purposes, you need to secure the phpMyadmin from hacker attacks. To do so, follow the instructions given at

(How to) Install and Secure PHP MyAdmin on Ubuntu 16.04
Learn how to install and secure PHP MyAdmin on Ubuntu 16.04 in easy step by step guide with ready to use images and codes. Click Here!Find out more about phpMyAdmin: https://help.ubuntu.com/community/phpMyAdmin