How to Install phpMyAdmin on CentOS 7 – Google Cloud

install phpMyAdmin on centos
install phpMyAdmin on centos

You can get simple and understandable steps to install phpMyAdmin on CentOS. Before we move into the installation, let’s have a brief look on phpMyAdmin.

What is this phpMyAdmin?

Let me tell you. phpMyAdmin is an open-source tool, which used to administrate MySQL over the web interface. phpMyAdmin is also used in MariaDB Database Management. phpMyAdmin is a GUI (Graphical User Interface ) based application. phpMyAdmin is available in 79 languages.

What is this CentOS?

CentOS is a Community Enterprise Operating System. It is an open-source platform for non-productive developmental work. For production concern, those works can be migrated to RHEL (Payable) Linux distribution platform.

Let’s have a quick look on phpMyAdmin features and versions available !!!

phpMyAdmin provides compatibility to Create , Alter, Add, Drop, Rename , Import tables from CSV and SQL and Export tables from CSV, SQL, XML, PDF, etc., phpMyAdmin can manage database, tables, fields, columns, indexes, relations, permission, etc., phpMyAdmin works with different operating systems and makes complex queries easier by using its predefined functions. You can create PDF graphics of database layout. You can also search globally in a database or subset of it. phpMyAdmin can administrate multiple servers.

Here’s the Complete Version list of phpMyAdmin  -> phpMyAdmin 4.9.1 , phpMyAdmin 5.0.0 alpha1, phpMyAdmin 5.1+ snapshot, phpMyAdmin 5.0+ snapshot, phpMyAdmin 4.9+ snapshot, phpMyAdmin latest.

Before Installation

Before we start,

Apache Web Server  – We need to install apache! Check out our article Install Apache on CentOS 7.
PHP  – Then we need to install PHP! Check out our article Install PHP on CentOS.
MySQL  – Then we need to install MySQL! Check out our article Install MySQL on CentOS 7.

Install phpMyAdmin on CentOS 7

Yeah, We are ready to start the installation of phpMyAdmin on CentOS. Let’s Go.


1) VM Setup:

First Step is to log-in to your google cloud account and then we need to select the option “Compute Engine” in the menu.

Now we can see “VM instances” in Compute Engine. Click on that as shown in below image.

Google Cloud VM Instances
Google Cloud VM Instances

As shown in the image, in the right end you can select “open in browser window”.

Now we can see the terminal and we are now ready to execute the below commands step by step.


2) Adding the EPEL Repository:

What is EPEL Repository? EPEL ( Extra Packages for Enterprise Linux) which creates, maintains, and manages a high-quality set of additional packages on CentOS. EPEL has an ‘epel-release’ package that includes GPG keys for package signing and repository information.  We can install the EPEL repository release using the following command.

sudo yum install epel-release

3) Install phpMyAdmin:

Now the EPEL repository is enabled. We can install phpMyAdmin package using the following command.

sudo yum install phpmyadmin

4) Configuration:

Configuration of phpMyAdmin is required to grant remote access. We are going to make changes in the config file. For that, we can get into the config file by using the below command.

vim /etc/httpd/conf.d/phpMyAdmin.conf

Once you entered the command, you will be able to see below lines in that file as shown in the image.

phpMyAdmin.conf
phpMyAdmin.conf

5) Edit phpMyAdmin.conf File:

In the above image, you can see the line “Require ip. The default value will be 127.0.0.1. You need to replace the IP string with your machine IP.

  • To update the change , press “i”.
  • Replace that “Require ip” with the IP of your machine. You can use the tool like WhatsMyIP to check your IP.
  • Saving the changes made in the config file, enter “:wq.
  • Then exit from the phpMyAdmin.conf file by pressing ESC Key.

Yeah ! The changes are updated in the phpMyAdmin.conf file.


6) Restart the Apache Web Server:

Now we need to sync up the updated phpMyAdmin.conf file with Apache Webserver. Once this is done, we are ready to start using phpMyAdmin. For that, we are going to restart the Apache webserver by using the following command.

systemctl restart httpd

After installation of phpMyAdmin


1) Testing phpMyAdmin:

To check the installation, we can browse our own phpMyAdmin. Let your server IP address be like ”127.0.0.1”.  So your browsing address will be (your IP)/ phpMyAdmin. Just like the below-mentioned browser address.

http://127.0.0.1/phpmyadmin

You could able to launch your own phpMyAdmin now.


2) Setup Login Credentials:

You can set your credentials (Username and Password) in a below-mentioned manner.
First, we need to get into the phpMyAdmin installation directory.

/etc/phpMyAdmin

Here you can find the below mentioned file.

config.inc.php

Now we are going to create your credentials in this file. By using below command we can edit the config.inc.php file.

vim config.inc.php

Once you opened the file, you can see configuration for Username and Password. Please refer the below image for better understanding.

phpMyAdmin Login Credential
phpMyAdmin Login Credential

Edit the file with your own credentials. As we did before, for Saving the changes made in the config file, enter “:wq. And then exit from the config.inc.php file by pressing ESC key.

Here you go…!! We successfully installed the phpMyAdmin on CentOS.
You can now start working on phpMyAdmin!!

Today, we learned about “What is phpMyAdmin”, “Basics of phpMyAdmin and CentOS” , “Features and Versions available in phpMyAdmin”, “Steps to be followed before installing phpMyAdmin ”, “How to install phpMyAdmin in CentOS?” , “Steps to be followed after installing phpMyAdmin” and finally “How to validated and login in phpMyAdmin”.

Hope it helped you in an easy way to install phpMyAdmin with more understanding. Please let us know in the comment section if you have any concern.

You can also share with your friends, who need to install phpMyAdmin. Will meet you in my upcoming articles.