How to Install phpMyAdmin on CentOS 6.2 Server

phpMyAdmin is a free software written in PHP intended to handle the administration of MySQL over the World Wide Web. It can manage a whole MySQL server (needs – super user ) and database. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement. In this article, I will explain step how to install phpMyAdmin on CentOS 6.2.

How to Install Httpd on CentOS 6.2
How to Install MySQL Database Server on CentOS 6.2
How to Secure MySQL Database Server

1. Install Php :

[root@centos62 ~]# yum install php php-mbstring php-mysql php-pdo php-cli php-common -y

2. To fix mcrypt not loaded warning on phpMyAdmin later on, kindly install php-mcrypt using the following steps and commands :

[root@centos62 ~]# wget http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
[root@centos62 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
[root@centos62 ~]# rpm --import RPM-GPG-KEY-EPEL-6
[root@centos62 ~]# rpm -i epel-release-6-5.noarch.rpm
[root@centos62 ~]# yum install php-mcrypt -y

3. Download phpMyAdmin :

[root@centos62 ~]# wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-all-languages.tar.gz
--2012-02-08 19:39:45--  http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-all-languages.tar.gz/download
Resolving sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-all-languages.tar.gz?r=&ts=1328701188&use_mirror=cdnetworks-kr-1 [following]
--2012-02-08 19:39:46--  http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-all-languages.tar.gz?r=&ts=1328701188&use_mirror=cdnetworks-kr-1
Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://cdnetworks-kr-1.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-all-languages.tar.gz [following]
--2012-02-08 19:39:47--  http://cdnetworks-kr-1.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-all-languages.tar.gz
Resolving cdnetworks-kr-1.dl.sourceforge.net... 211.39.135.162
Connecting to cdnetworks-kr-1.dl.sourceforge.net|211.39.135.162|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5763130 (5.5M) [application/x-gzip]
Saving to: âphpMyAdmin-3.4.9-all-languages.tar.gzâ

100%[==========================================================>] 5,763,130   39.4K/s   in 91s

2012-02-08 19:41:18 (62.2 KB/s) - âphpMyAdmin-3.4.9-all-languages.tar.gzâ

4. Copy phpMyAdmin-3.4.9-all-languages.tar.gz to DocumentRoot and extract the tar file. Make phpMyAdmin-XX executable. Create config folder and make it writable :

[root@centos62 ~]# mv phpMyAdmin-3.4.9-all-languages.tar.gz /var/www/html/
[root@centos62 ~]# cd /var/www/html/
[root@centos62 html]# tar -xzvf phpMyAdmin-3.4.9-all-languages.tar.gz
[root@centos62 html]# chmod 655 phpMyAdmin-3.4.9-all-languages/
[root@centos62 html]# mv phpMyAdmin-3.4.9-all-languages phpmyadmin
[root@centos62 html]# cd phpmyadmin

5. Copy config.sample.inc.php into config.inc.php. config.inc.php will be the main configuration file :

[root@centos62 phpmyadmin]# cp config.sample.inc.php config.inc.php

6. Create phpmyadmin database :

mysql> CREATE DATABASE phpmyadmin;
Query OK, 1 row affected (0.00 sec)

7. Create the pma user and give access to databse and tables :

mysql> CREATE USER 'pma'@'localhost' IDENTIFIED BY 'pmapassword';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON phpmyadmin.* to pma@localhost;
Query OK, 0 rows affected (0.00 sec)

8. Import the create_tables.sql into phpmyadmin database :

[root@centos62 ~]# mysql -u pma -p -h localhost phpmyadmin < /var/www/html/phpmyadmin/scripts/create_tables.sql
Enter password:

Now, the "phpmyadmin" database has been created, and also the user "pma" exists with that password, that user has all privileges on DB "phpmyadmin" and has all privileges on all tables.

See also  How to Add the RPMforge Repository on CentOS 6/RHEL 6 Linux Server

9. Edit configuration file as below :

[root@centos62 ~]# vi /var/www/html/phpmyadmin/config.inc.php

9.1 Modify config.inc.php and add blowfish_secret as below :

$cfg['blowfish_secret'] = 'blowfish_secret@123'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

9.2 Please change auth_type to “cookie” :

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';

9.3 Enable advanced features in configuration file as below. Uncomment the below lines :

/*
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapassword';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
 * End of servers configuration

10. You can start using phpMyAdmin :

See also  How to Install Zimbra Collaboration Suite 7.1.3 Mail Server on Redhat Enterprise Linux 5.5

http://ipaddress/phpmyadmin

Comments

6 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *