Skip to main content

PHPMYADMIN ON CENTOS 6.9



PhpMyAdmin is a free software tool written in PHP for handling the administration of MySQL through Web. phpMyAdmin supports a large number of operations on MySQL and MariaDB.It makes users to use mysql and mariadb easily.


First we need to setup a lamp server.
( For that follow our documents in  http://www.goserverspace.com/2017/09/lamp-on-centos-68.html)



Next step is installing phpmyadmin.By default it will not be available.So we want to create a  epel repo.

#vi /etc/yum.repos.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
priority=10
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 Save and Close the file

Now update the repo
#yum update -y
#yum repolist


Now we can install phpmyadmin package

#yum install phpMyAdmin

The next step is configuring phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the <Directory "/usr/share/phpmyadmin"> stanza):

#vi /etc/httpd/conf.d/phpMyAdmin.conf


[...]
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

#<Directory /usr/share/phpMyAdmin/>
#   <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>


#<Directory /usr/share/phpMyAdmin/>
#       Options none
#       AllowOverride Limit
#       Require all granted
#</Directory>

[...]

Save the file and close it.


Next we change the authentication in phpMyAdmin from cookie to http:

#vi /etc/phpMyAdmin/config.inc.php

[...]
$cfg['Servers'][$i]['auth_type']     = 'http';    // Authentication method (config, http or cookie based)?
[...]


Save the file and restart apache service
#systemctl restart httpd


Now open your browser and access phpmyadmin http://localhost/phpmyadmin or http://your ip/phpmyadmin.