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

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.

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

mysql_secure_installation

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';

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

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

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.

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: