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  Nginx Released Version Nginx 1.8.x

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 Display processlist in MySQL

http://ipaddress/phpmyadmin

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

6 Comments

1 Trackback or Pingback

Leave a Reply

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