How to Install phpMyAdmin on Ubuntu 18.04


MySQL is a free open source relational database management system. It is used in many applications. LAMP is a necessary part of the web application stack and also includes Apache, the free, open source and multiplatform web server.

While you can do everything from the command line interface, some prefer a GUI (Graphical User Interface) for working on databases.

Which brings us to phpMyAdmin. phpMyAdmin is a free and open source GUI tool for managing MySQL databases. Although installing phpMyAdmin on Ubuntu server is quite easy, with the release of Ubuntu 18.04 this process has changed a bit because root users’ access to applications is disabled for security reasons.

In this article, you will learn how to install phpMyAdmin on Ubuntu 18.04 running with MySQL database on Apache server.

What’s needed
To install phpMyAdmin, you need an Apache server with MySQL database and running on Ubuntu 18.04 operating system. As such, you also need to be familiar with the command line interface.

Installing phpMyAdmin on Ubuntu 18.04
If you have the applications we mentioned working properly, it is quite easy to install.

Open the command line interface and access your VPS using SSH. Are you having trouble? Check out our PuTTy guide!

Then enter the following command:

sudo apt-get install phpmyadmin php-mbstring php-gettext –y

Note that you will be asked to choose a web server during the installation phase. Press Space, then Tab to select apache2 and then press Enter to continue.

You will then be prompted to configure the database. Select Yes and continue.

Set a “MySQL application password for phpMyAdmin”. Make sure you use a strong enough and different password. Reconfirm when prompted.

Finally, enter the database administrator user password.

When the installation process is complete, open your browser and enter http://SERVER_IP/phpmyadmin (SERVER_IP is your server’s IP address) in the URL bar.

If you are using localhost, use the URL http://localhost/phpmyadmin and login.

Note that you cannot login as root user on Ubuntu 18.04 for security reasons. So log in with the phpmyadmin username and the MySQL password you set earlier.

Immediately after logging in you will see that the phpMyAdmin interface has very limited options. For an easy solution to this phpMyAdmin user interface you need to give some permissions to the phpmyadmin user.

Allow User “phpmyadmin”
Open the command line interface and login to MySQL with the following command:

sudo mysql -u root –p

Give permissions to the phpmyadmin user with these commands:

GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost';

If you are still logged in to phpMyAdmin, log out and log in with the same phpmyadmin username and password. You will now have full permissions for MySQL.

ubuntu phpmyadmin


Please enter your comment!
Please enter your name here