In this tutorial we will learn to install phpMyAdmin on CentOS server.
phpMyAdmin is an open-source and free tool written in php to access and manage MySQL and MariaDB from a web browser.
So, lets get started with the installation process...
Its a best practice to first clean up and update yum and then perform installation.
Clean up yum by typing the following in terminal.
# sudo yum clean all
Now perform the update
# sudo yum -y update
EPEL (Extra Packages for Enterprise Linux) contains the many packages for CentOS including phpMyAdmin. So use the following command to install epel.
# sudo yum install epel-release
Use the following command to install phpMyAdmin.
# sudo yum install phpmyadmin
After phpMyAdmin installation is complete open /etc/httpd/conf.d/phpMyAdmin.conf file and make the following changes
Open the file using vi
# sudo vi /etc/httpd/conf.d/phpMyAdmin.conf
Switch to INSERT mode by pressing i key and comment out the lines using
#Apache 2.4 # Require ip 127.0.0.1 # Require ip ::1 Require all granted
The file content will look like the following.
<Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> #Require ip 127.0.0.1 #Require ip ::1 Require all granted </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory>
Once you are done with the changes press ESC key to exit INSERT mode. Save the file using the
Now restart Apache using the following command.
# sudo systemctl restart httpd
To open phpMyAdmin in the browser go to your server ip address or your domain name and type in phpmyadmin.
If configuration was properly done then you will see the following screen.
Login using the database username and password and you will see the following screen.
Congrats! you have installed phpMyAdmin successfully. Have fun coding!