In this guide, we will consider installing phpMyAdmin on a newly installed server or VPS running Ubuntu 18.04 or Centos 7.7.PhpMyAdmin is a very simple and convenient tool for managing MySQL databases.

Installation on Ubuntu 18.04

First, install the LAMP software stack (Linux, Apache, MySQL, PHP):

apt-get update
apt-get install tasksel
tasksel install lamp-server

How to install phpMyAdmin - Image 1

Next, following the prompts, select a web server, agree to create a database for phpMyAdmin, and come up with a password for the phpmyadmin user.

How to install phpMyAdmin - Image 2 How to install phpMyAdmin - Image 3 How to install phpMyAdmin - Image 4

The next step is to configure root access to phpMyAdmin. Enter the following command in the terminal and follow the prompts:

mysql_secure_installation

How to install phpMyAdmin - Image 5

You may also need to switch the root user authentication method from auth_socket to mysql_native_password:

mysql
SELECT user,plugin,host FROM mysql.user WHERE user = 'root';

How to install phpMyAdmin - Image 6

Run the following query to change the value of the plugin to mysql_native_password. By default, the password is required to be at least 8 characters long and contain uppercase and lowercase letters, numbers, and special characters.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'enter_password_here';

Now you can open a browser and go to your server address:

http://xxx.xxx.xxx.xxx/phpmyadmin/index.php

How to install phpMyAdmin - Image 7 How to install phpMyAdmin - Image 8

Installation on Centos 7.7

First, install the LAMP software stack (Linux, Apache, MySQL, PHP):


yum -y update && yum -y install nano httpd mariadb-server mariadb php php-mysql && systemctl enable httpd && systemctl enable mariadb && systemctl enable --now httpd && systemctl enable --now mariadb

After that, you can proceed to install phpMyAdmin:

yum -y install epel-release && yum -y install phpmyadmin

Edit the phpMyAdmin.conf file:

nano /etc/httpd/conf.d/phpMyAdmin.conf

How to install phpMyAdmin - Image 9

By default, access to the phpMyAdmin web interface is allowed only for the computer on which it is installed. To access the web interface, change the highlighted values to your external IP address or to allow access for everyone, bring the settings file to the form as shown in the screenshot below.

How to install phpMyAdmin - Image 10

The next step is to configure root access to phpMyAdmin. Enter the following command in the terminal and follow the prompts:

mysql_secure_installation

This completes the installation. Now you can open a browser and go to your server address:

http://xxx.xxx.xxx.xxx/phpmyadmin/index.php
Tagged: