Install and remote access phpMyAdmin on CentOS

  Peter        2012-06-21 07:30:29       18,661        0    

phpMyAdmin is a free and open source tool written in PHP intended 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.

Today I walk through you the steps to install phpMyAdmin on CentOS. Actually, these steps are applicable to other Linux systems as well.

1. Download the phpMyAdmin from Sourceforge.net. Run command:

wget -c http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.1/phpMyAdmin-3.5.1-english.tar.gz  /download

Currently the latest version of phpMyAdmin on Sourceforge.net is 3.5.1. After finishing downloading, you can run ls -a to check that the phpMyAdmin-3.5.1-english.tar.gz exists.

2. Move the downloaded file to your website root folder. For example, /var/www/html.

mv phpMyAdmin-3.5.1-english.tar.gz /var/www/html/
cd /var/www/html/

You will find the phpMyAdmin-3.5.1-english.tar.gz in /var/www/html/ now.

3. Extract the files. Run

tar xvfz phpMyAdmin-3.5.1-english.tar.gz
mv phpMyAdmin-3.5.1-english phpmyadmin

4. Find the config.sample.inc.php file in phpmyadmin directory and make a copy of it and rename it to config.inc.php. Open the config.inc.php and find the values

$cfg['Servers'][$i]['auth_type']=’cookie’;
you may change it to
$cfg['Servers'][$i]['auth_type']=’http’;
if you like. But this step is not necessary.

5  Now run

service httpd restart

to restart the apache server.

You should now be able to access the phpMyAdmin using http://domain.com/phpMyAdmin now. Wait, you forget the username and password for phpMyAdmin. By default, they are your database username and password.

Sometimes you may have the forbidden access error when you try to access the phpmyadmin, then you can try to create a phpmyadmin.conf file in /etc/httpd/conf.d/. And add following codes into the file

<Directory /var/www/html/phpMyadmin>
Order allow,deny
Options Indexes
Allow from all
</Directory>

The Allow from all means that all computers can access phpMyAdmin besides the local computer.

If you are using Zend Framework or other frameworks, usually they have URL rewrite rules set in .htaccess, then you need to tell the server how to access phpMyAdmin directory. So in your .htaccess file, you should tell the server that ignore URL rewrite when accessing phpMyAdmin. Remember add the line

RewriteRule ^phpmyadmin - [L,NC]

immediately after the RewriteEngine on line. Otherwise, you may encounter some problems with accessing other contents in your website.

PHPMYADMIN  LINUX  INSTALLATION  DEMO 

       

  RELATED


  0 COMMENT


No comment for this article.



  RANDOM FUN

Consequence of a sudden state change