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
[root@centos62 ~]# wget
[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
--2012-02-08 19:39:45--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2012-02-08 19:39:46--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2012-02-08 19:39:47--
Connecting to||: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 into will be the main configuration file :

[root@centos62 phpmyadmin]# cp

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.

9. Edit configuration file as below :

[root@centos62 ~]# vi /var/www/html/phpmyadmin/

9.1 Modify 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 :