How to install phpMyAdmin on Ubuntu 18.04

MySQL is a free and open source relational database management system widely used in many typical applications. It is an integral part of the web application stack that also includes Apache, a free, open source, cross-platform web server. Knowing this, let’s move on with the explanation of how to install phpmyadmin in Ubuntu 18.04.

And it is that, although you can do everything through the command line interface, some people prefer to use a GUI, or a graphical user interface, to work on databases.

That brings us to phpMyAdmin. PhpMyAdmin is a free and open source GUI tool for managing MySQL databases. Although it is relatively easy to install phpMyAdmin on Ubuntu server, the procedure changed quite a bit with the release of Ubuntu OS version 18.04 where root user access for applications was disabled due to security issues.

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

Prerequisites

To install phpMyAdmin following this tutorial, you must have an Apache server with the database running on it. Ubuntu 18.04 operating system. You should also be familiar with the command line interface.

Install phpMyAdmin on Ubuntu 18.04

The installation procedure is quite easy if you have the aforementioned applications running smoothly.

Open the command line interface and access su using SSH. Do you have problems doing it? Check out our !

Then type the following command:

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

Please note that during the installation process, you will be prompted to select a web server. Select by pressing the space bar and then the Tab key and press the Enter key to continue.

See also  What is a blog? An Introduction to Blogging

You will then be prompted for a database configuration. Select Yes and continue.

Set a “MySQL application password for phpmyadmin” (in English it will appear as “MySQL application password for phpmyadmin”). Make sure you use a strong and unique password. Enter the password again when prompted.

Finally, enter the password of the database administrator user.

When the installation procedure is complete, open your browser and type the URL http://SERVER_IP/phpmyadmin (where SERVER_IP is the IP address of your server).

In case you use localhost, use the URL http://localhost/phpmyadmin and sign in.

Please note that in Ubuntu 18.04, you cannot log in as the root user due to security issues. So, log in with the MySQL username phpmyadmin and password that you set up earlier.

Now, immediately after logging in you will discover that the phpMyAdmin interface has very limited options available. To make this phpMyAdmin user interface a practical solution, you need to grant some permissions to the phpmyadmin user.

Grant permissions to the user “phpmyadmin”

Open the command line interface and log in to MySQL with the command:

sudo mysql -u root –p

Grant permissions to the phpmyadmin user with these commands:

GRANT ALL PRIVILEGES ON *.* TO ‘phpmyadmin’@’localhost’; FLUSH PRIVILEGES; EXIT

Now log out of phpMyAdmin, if it is still active, and log in again with the same phpmyadmin username you used before. You will now have full privileges for MySQL.

Alternative solution

For security reasons, if you don’t want to use or work with the default phpmyadmin user account, you can create a new MySQL admin user with full privileges. Just type these commands at the command line interface:

See also  How to Add Meta Description, Meta Title and Keyphrase in WordPress

CREATE USER USER IDENTIFIED by ‘PASSWORD’; GRANT ALL PRIVILEGES ON *.* TO ‘USER’@’localhost’; FLUSH PRIVILEGES; EXIT

Keep in mind that the USERNAME and PASSWORD must be unique and secure. Replace “USER” in the second line with the username you created in the first (where you assign the password). All commands must be executed one line at a time.

Restart the Apache server if you encounter any problems logging in. The command to restart the server is:

sudo service apache2 restart

It is recommended to take a look at the “Status” tab, this will show you a number of connections to the MySQL server, the current MySQL queries running on the server and the server uptime.

concluding

That is all! You have learned how to install and configure phpMyAdmin on Ubuntu 18.04 with the proper admin permissions granted. Now you can start working with some of its more advanced features. See the official phpMyadmin documentation for more information.

Deyi is a digital marketing enthusiast, with a background in web design, content creation, copywriting, and SEO. She is part of ‘s SEO & Localization team. In her free time, she likes to develop projects, read a book or watch a good movie.

Loading Facebook Comments ...
Loading Disqus Comments ...