As mentioned before, phpMyAdmin is an easy panel for you to control MySQL, so that you can easily add and optimize databases for your websites or blogs.
The following will show you how to install the latest version of phpMyAdmin from source on a Ubuntu VPS with the Terminal application of Mac, and there will be only 5 steps:

Step 1. Forward Domain
Instead to use a new domain for phpMyAdmin, you can also use a sub-domain of any domain you have, and what you need to do is to log in your domain server account, and forward the sub-domain to your VPS, such as the following:
A: freenuts.org to 216.24.194.31
CName: www.freenuts.org to freenuts.org
CName: phpmyadmin.freenuts.org to freenuts.org
Remember to change "freenuts.org" to your domain name, and to change "216.24.194.31" to the IP address of your VPS.
Tip: It is better to change "phpmyadmin" to any other word you like, so that your phpMyAdmin will be safer, since people are harder to find it.
Step 2. Install PHPMyAdmin
The installation of phpMyAdmin is very easy, only needs a few commands:
cd /opt
wget http://hivelocity.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.5/phpMyAdmin-3.4.5-all-languages.tar.gz
(P.S.: 3.4.5 is the latest stable version of phpMyAdmin, and you can get more versions on the official download page.)
tar -xzvf phpMyAdmin-3.4.5-all-languages.tar.gz
mv phpMyAdmin-3.4.5-all-languages phpmyadmin
(P.S.: This command is not MUST, but is cool.)
Tips: After installation, the download package is not useful, and you can delete it with the following command:
rm -rf phpMyAdmin-3.4.5-all-languages.tar.gz
Step 3. Configure Nginx
phpMyAdmin is based on PHP, which can be actived with Nginx in two different ways as mentioned before, now we are using the popular "sites-enabled" way to configure phpMyAdmin.
Firstly, enter the following command:
nano /usr/local/nginx/conf/sites-enabled/phpmyadmin
Secondly, copy and paste the following contents:
server {listen 80;
server_name phpmyadmin.freenuts.org;access_log /usr/local/nginx/logs/phpmyadmin.access.log;
root /opt/phpmyadmin;
location / {
index index.html index.htm index.php;
}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi.conf;
}
}
Remember to replace "phpmyadmin.freenuts.org" with your domain name for phpMyAdmin. Then save the file.
Tips:
As you can see, the contents of the phpmyadmin file is very similar with any other files in the sites-enabled folder, to which you can refer for how to add multiple websites.
Step 4. Configure PHPMyAdmin
To connect MySQL with phpMyAdmin, you only need to create and edit a file called config.inc.php, which can be copied from the config.sample.inc.php file with the following commands:
cd /opt/phpmyadmin
cp config.sample.inc.php config.inc.php
Then enter the following command:
vi config.inc.php
Delete all the contents with "dG", and press the "i" key to insert the following contents:
<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'your.mysql.root.password';
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
Remember to change "your.mysql.root.password" to the root password you set up when installing MySQL as mentioned before.
Step 5. Reboot VPS
Enter "reboot" to reboot your VPS, which may takes a little time, then open your browser and enter the following URL in the address bar:
http://phpmyadmin.freenuts.org/
Remember to change "phpmyadmin.freenuts.org" to your domain used for phpMyAdmin, if you can log in with the user "root" and its password, then you can add databases for your WordPress blogs.
Related free web apps:

