phpMyAdmin is a free web application which will make it easier working with MySQL, it will provide simple backup,restore and other MySQL GUI features, in this tutorial i will show you how to install phpMyAdmin on Centos, download phpMyAdmin, and this can be applies to localhost phpMyAdmin too.
Install phpMyAdmin on Centos 7
In this article i will be installing phpMyAdmin on CentOS 7, this can work on RHEL 7 and other flavors too.
- Be sure that Apache httpd is installed
- Latest epel release is installed by running: "EPEL Repository is an additional repo which will provide with a lot of extra packages to be installed with ease using yum"
rpm -iUvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm Or yum install epel-release
- Be sure php 5.6 is installedrpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install php56w php56w-opcache
Check if phpMyAdmin is available in your repo
yum search phpmyadmin
yum install phpmyadmin -y
Secure and enable phpMyAdmin
Now we need to edit the phpMyAdmin configuration to enable specific IPs or all.
Edit Require ip 127.0.0.1 parts in all sections
<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 </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>
Allow all public access
Replace all <RequireAny> tags with:
# Require ip 127.0.0.1
# Require ip ::1
Require all granted
First phpMyAdmin login password
Password to be used with phpMyAdmin is your MySQL password, if you don't have a credentials please follow below steps to create root password
- Login to server
- Connect to MySQL
update user set password=PASSWORD("mynewpassword") where User='root';
flush privileges ;
Replace above mynewpassword with your desired password.