Install PHPMyAdmin on CentOS LAMP Server


here it is the tutorial to guide you how to install PhpMyAdmin on a CentOS server running LAMP stack (Linux, Apache, MySQL, PHP). However I assume by following this tutorial you have already had a server with LAMP stack installed, configured and running properly.

What you’ll need?

  1. This guide is done in a CentOS 6.4 x86_64 VPS , you’ll need a CentOS server. However you can still follow the tutorial by adjusting some commands if you are using any other Linux Distros.
  2. I also assumed you knew already how to use Putty or Terminal to SSH-ing a server.
  3. I believe you knew –at least part of– most common Unix commands used to manage an unmanaged server.

How To Install PHPMYADMIN

Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.

Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root. You may also need to type this command to go to the root directory:

1. cd ~
Step 2 – Install PhpMyAdmin via yum using this command:

1. yum installphpmyadmin -y
pma-install

So the you’ve installed PhpMyAdmin but you may also firstly need to edit Apache configuration before using it. Edit phpmyadmin.conf file:

nano /etc/httpd/conf.d/phpmyadmin.conf
#  Web application to manage MySQL
#
<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
</Directory>
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
Now you’ll need to comment (add # symbol) starting from <Directory “/usr/share/phpmyadmin”> till the </Directory> line. This is aimed to change the Apache configuration so that phpMyAdmin allows connections not just from localhost. At the end it should look like this:
pma-setup

Now save (Control+O) then exit Nano editor (Control+X).

This step is optional, changing how the way you login to PhpMyAdmin from “cookie”-based authentication to “http”. Edit PhpMyAdmin configuration file (config.inc.php):
nano /usr/share/phpmyadmin/config.inc.php
then look for the line that says:

$cfg['Servers'][$i]['auth_type'] = 'cookie';

now replace ‘cookie’ with ‘http’

$cfg['Servers'][$i]['auth_type'] = 'http';
pma-http

Once done, save it then exit Nano editor.
Finally, restart Apache and MySQL:pma-restart

Access and Login PHPMYADMIN

You can access PhpMyAdmin in your browser via:

http://your.ip.address/phpmyadmin

or

http://yourdomain/phpmyadmin

Your browser should directly prompt you to enter username and password. You can simply use root as username and enter its password. Remember, the password is the MySQL root password not your server root password. You can also use any other MySQL username and password if you have created one

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: