How To Install and Configure phpMyAdmin in Centos6/RHEL6

0
1400

Overview :

phpMyAdmin is a free and open source software written in PHP and used to handle the administration of MySQL with the use of a Web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions

Prerequisites of phpMyAdmin :

Following following packages should be installed on linux machine in which we are going to install phpMyAdmin

php
php-mysql
httpd
mysql-server

To Verify the packages are installed or not :

[root@localhost ~]# rpm -qa | egrep -i "php|php-mysql|httpd|mysql-server"

if these packages are not installed  , use the below command to install

[root@localhost ~]# yum install php  php-mysql httpd mysql-server

 

Step:1 Create a directory using below command
[root@localhost ~]#  mkdir /download
[root@localhost ~]# cd /download

 

Step:2 Download the latest phpmyadmin tar file using below comand
[root@localhost download]# wget http://citylan.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/
3.5.6/phpMyAdmin-3.5.6-all-languages.tar.bz2

 

Step:3 Extract or untar the file using below command
 root@localhost download]# tar jxpvf phpMyAdmin-3.5.6-all-languages.tar.bz2

 

Step:4 Move phpmyadmin folder to default document root of apache web server
[root@localhost download]# mv phpMyAdmin-3.5.6-all-languages /var/www/html/phpmyadmin

 

Step:5  Change the directory
[root@localhost download]# cd /var/www/html/phpmyadmin/
Step:6 copy the config file
 [root@localhost phpmyadmin]# cp config.sample.inc.php config.inc.php

 

Step:7 Now edit config.inc.php file , change Authentication type from cookie to http
[root@localhost phpmyadmin]# vi config.inc.php

phpmyadmin-config

save & exit

Step: 8 Now start the apache and mysql service
[root@localhost phpmyadmin]# service httpd restart
[root@localhost html]# /etc/init.d/mysqld restart

Note :

1. Also Make sure selinux is disabled or else write the selinux rule, so that apache can read phpmyadmin files
2. Set the mysql root password if not set use below command :

[root@localhost ~]# mysqladmin -u root password NEWPASSWORD
 
Step:9 Now Access phpmyadmin from your broswer

http://localhost/phpmyadmin  or http://192.168.2.129/phpmyadmin

Use root as username and password that you have set using above mysqladmin command , after entring the correct credentials  , you will get below windows where you can perform all database admin tasks.

phpmyadmin

SHARE

LEAVE A REPLY