In order to install MySQL and PHP on the CentOS 6 Server you may use the Following Steps.

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

[root@centos ~]# yum install php php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml php-mbstring

In Order to Install the PHPMyAdmin you may follows these instructions.

In order to download the PHPMyAdmin you may refer to the official website of PHPMyAdmin at the URL :: http://www.phpmyadmin.net/home_page/downloads.php and download you choice of PHPMyAdmin version.

Like the following

[root@centos ~]# cd /usr/local/src
[root@centos ~]# wget -c http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-english.tar.gz

Once you download the tar file phpMyAdmin-3.4.9-english.tar.gz you will have to extract it at the servers default Document Root to know it you may use the following commands

[root@centos ~]# grep DocumentRoot /etc/httpd/conf/httpd.conf

DocumentRoot “/var/www/html”

*DocumentRoot: The directory which will serve the content when the domain/hostname is accessed using browser 

[root@centos ~]# mv /usr/local/src/phpMyAdmin-3.4.9-english.tar.gz /var/www/html

[root@centos ~]# cd /var/www/html

Extract the downloaded tar archive

[root@centos ~]# tar -xzvf phpMyAdmin-3.4.9-english.tar.gz

Rename it to phpmyadmin

[root@centos ~]# mv phpMyAdmin-3.4.9-english phpmyadmin

Copy the sample confige file to make it working configuration file

[root@centos ~]# cd phpmyadmin

[root@centos ~]# cp config.sample.inc.php config.inc.php

Edit the configuration file to your liking. The basic settings can be referred as follows

[root@centos ~]# vi config.inc.php
================================================================================================
/* Authentication type */
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
/* Server parameters */
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘compress’] = false;
================================================================================================

Make Sure You Un-comment the User Settings in the file
================================================================================================
/* User used to manipulate with storage */
$cfg[‘Servers’][$i][‘controluser’] = ‘pma’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘pmauser’;
================================================================================================

Other Key Settings Are as follows
================================================================================================
/* 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’;
================================================================================================

If you face any issues you may also assign full privalegs to all pma user over phpmyadmin database or ALL the dbs on the server

[root@centos ~]# mysql -u root -p
[root@centos ~]# Password :: ( Insert the mysql root password )

To reset the root mysql user password use the following command

/usr/bin/mysqladmin -u root password ‘new-password’

Now from mysql prompt you may create separate database for phpmyadmin

mysql> CREATE DATABASE phpmyadmin;

GRANT privlages to the user pma which is there in the PHPMyAdmin Configuration file

mysql> GRANT ALL ON phpmyadmin.* TO pma@localhost IDENTIFIED BY ‘pmauser’;

OR

mysql> GRANT ALL ON *.* TO pma@localhost IDENTIFIED BY ‘pmauser’;

Here pmauser is the password which you wish to have for the pma user, make sure it matches with config.inc.php

Now you are all set to access the phpmyadmin at the URL :: http://serverIP/phpmyadmin/

 

If you are getting error saying “The mcrypt extension is missing. Please check your PHP configuration.”

You may install it using the following steps

Please install RPM based on the OS type 64 or 32 bit

[root@centos ~]# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

[root@centos ~]# rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm

[root@centos ~]# yum install php-mcrypt

Now to finalize phpMyAdmin setup you may access the URL ::

http://serverIP/phpmyadmin/setup/index.php

Now you are free to configure the settings as per your liking 😉