Install phpMyAdmin on VPS or Amazon EC2 and VPC

If you Install phpMyAdmin on VPS or Amazon EC2 and VPC, then SQL DB management can be made simple and very powerful. phpMyAdmin is DB administration control panel written in php. This is free and gives you all the options to handle a database including maintenance, repair, cleaning, backups and restore. This is a must have for any webmaster.

I am assuming that you have already installed PHP, MySQL and Apache. This guide is basically for CentOS linux however, can be used for any linux if some commands are replaced; for e.g. wget.

TIP: Ec2 or VPC user using Amazon linux need to use “sudo” in front of every command or things will not work. Alternatively, type “sudo su” once and get rid of typing sudo every time.

So, Let’s Install phpMyAdmin on VPS or Amazon EC2 and VPC :

1. First of all, login to your VPS server or Amazon EC2 or VPC server using PuTTY. You can also use any other SSH client.
2. Go to this download page of phpMyAdmin website.
3. Select your version and language. Version is important as latest phpMyAdmin can only be ran if you have PHP 5.3+ on your server.

I have selected the latest version available at the time of writing this article It was “phpMyAdmin-3.5.3-all-languages.tar.gz”.

4. Click it. So you will go to download page. There will be a direct link. Right click it and copy that URL.
5. Go back to Putty. Now type “wget”, give a space and paste that copied address. Hit enter. Server address will be resolved and download will start. Wait for it to complete.

Alternatively, you can just copy paste following to get it downloaded;

All the contents will be extracted to root folder in a folder ‘phpmyadmin’

7. Now, you need to create another folder ‘phpmyadmin’ but under folder ‘html’ folder. So use this;

mkdir /var/www/html/phpmyadmin

8. You will now need to copy all the contents of extracted folder to this newly created folder;

cd phpmyadmin

cp -R * /var/www/html/phpmyadmin

9. Restart apache server;

service httpd restart

or

/etc/init.d/httpd restart

Now, go to browser and type “yourdomain.com/phpmyadmin”. You should be greeted with phpMyAdmin login page. Use your MySQL root login and password. If you don’t have it you can reset or change it via webmin. For assistant you can follow this guide.

If you are unable to get to phpMyAdmin page then you will need to configure some settings and do some installations. Don’t worry it’s a breeze. However to avoid complexity and getting off-topic I am just linking it to other article as I can’t include all of them here.