Superfast way to setup phpMyAdmin : Simple as 1-2-3

PUBLISHED ON Fri 29, 2010 | POSTED IN What I learnt

Okay, you are stuck with a host that does not provide phpMyAdmin or you have a standard cpanel hosting account, where if you need to give a developer or somebody else access to phpMyAdmin, you need to give them access to cpanel, which gives them access to the entire hosting control panel,a big risk.



These situations are common but don’t despair, setting up of phpMyAdmin and get it up and running can be done in a few simple steps. There are two ways to do this. Both the methods illustrated are for linux hosts only. Even though the steps to setup phpMyAdmin are the same in both Windows and Linux hosts, the commands are different.

Method 1. Setup phpMyAdmin Via SSH/Commandline
If you have ssh command line access, this is the fastest and easiest way to setup phpmyadmin

Step 1: Login to the commandline using “putty” if using windows or any other SSH client.

Step 2: Move into the webroot of the domain for which you are going to setup phpMyAdmin
$ cd public_html

Step 3: Wget the phpMyAdmin tar.gz file from sourceforge
$ wget http://space.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.8/phpMyAdmin-3.3.8-english.tar.gz
This will download phpMyAdmin directly from sourceforge into your server.

Step 4: extract the tar.gz file
$ tar xvzf phpMyAdmin-3.3.8-english.tar.gz
When you run this command, phpMyAdmin will be extracted in a “phpMyAdmin-3.3.8-english” directory

Step 5: Rename the “phpMyAdmin-3.3.8-english” directory to something simple, say “pma”
$ mv phpMyAdmin-3.3.8-english pma

Step 6: Now you need to rename the “config.sample.inc.php” file to “config.inc.php”. But before that we need to go inside the pma directory
$ cd pma
$ mv config.sample.inc.php config.inc.php

Step 7: The last one!! You need to edit config.inc.php. In around the 30th line of config.inc.php , you would have to replace
$cfg['Servers'][$i]['auth_type'] = 'cookie'; with
$cfg['Servers'][$i]['auth_type'] = 'http';
i.e ‘cookie’ has to be changed to ‘http’. For this you can either edit the file via vi or nano by typing
$ vi config.inc.php or
$ nano config.inc.php
then change the values and save the file.

That’s it ! you can now access phpMyAdmin via http://yourdomain.com/pma . Enter username as your database username and password as your database password and login and enjoy!

Method 2. Setup via ftp
This is not the fastest method, but if you don’t have SSH command line access, you need to use this method. This method, worst case wouldn’t take you anything more than 5 minutes anyways to setup phpMyAdmin.

If you are on a cpanel hosting, or a hosting which provides filemanager in the control panel, you are a little bit lucky.

You can download the tar.gz or .gz version of phpMyAdmin from here to your computer and the upload the file to your public_html folder. Then extract the archive file using the file manager. You can then rename the “phpMyAdmin-3.3.8-english” folder which is created to a simpler name say “pma”. Move into the pma folder and do the steps 6 & 7 as mentioned in the SSH method i.e rename config.sample.inc.php to config.inc.php and edit the config.inc.php and replace
$cfg['Servers'][$i]['auth_type'] = 'cookie'; with $cfg['Servers'][$i]['auth_type'] = 'http'; . You are now done.

If you do not have a file manager as a part of your hosting control panel, then the only option you have is download a phpMyAdmin.zip or any archived version from here , then extract the files in your computer, upload the phpMyAdmin folder into your public_html folder using an ftp software like filezilla and then execute steps 6 & 7

 

Add a comment