Install phpMyAdmin within Linux (Ubuntu 18.04)


Install phpMyAdmin within Linux (Ubuntu 18.04)

Introduction

This is a quick step-by-step tutorial on how to install phpMyAdmin within linux (Ubuntu 18.04). The phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web.  The phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.

Before continuing, install MySQL server or MariaDB.

Step 1: Install phpMyAdmin within Linux

Ubuntu distributions with APT (Advanced Packaging Tool) offer a simple way to do this:

sudo apt install phpmyadmin

Also, you can update package repository before that line: sudo apt update .

Size of phpMyAdmin is around 80MB. You will be prompted to select HTTP server (Apache2, lighttpd).

install phpMyAdmin within linux webserver

Select the one you have by pressing SPACE (or none if you have NGINX – check 1b). Hit ENTER when finished.

install phpMyAdmin within linux automatic

Here we’ll select Yes, just to speed things up. You can select No and set things manually. Next, phpmyadmin user password prompt:

install phpMyAdmin within linux pass

Finished. With this you can open phpMyAdmin control panel url:

http(s)://SERVER/phpmyadmin

Depending on your MySQL setup, additional configuration might be required. For now, you can try and login with the password you just set, and username = phpmyadmin.

 

There is a slight difference in steps between Apache/httpd and Nginx.

1a: phpMyAdmin config on Apache/httpd

On web server selection step, simply choose Apache2 and everything should be configured automatically.

1b: phpMyAdmin config on NGINX

In case you have NGINX web server, don’t select anything on web server selection step. Leave it empty. Finally,  make a soft link within web folder towards phpmyadmin .

sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html

Conclusion

That’s it. You’re basically ready to go. You should pay more attention to security. Alter phpMyAdmin path, select good MySQL usernames/passwords, restrict remote access to root users, etc. As always, you can also check current vulnerabilities (CVE – Common Vulnerabilities and Exposures) on sources like CVEDetails / MITRE CVE or phpMyAdmin security  .  Try to make things up-to-date in order to avoid potential problems with unwanted guests. Since most of the phpMyAdmin vulnerabilities seem to be CSRF/XSRF and XSS, mind your steps…