Installing MySQL and PHPMyAdmin on Ubuntu VPS

This entry is part 4 of 5 in the series Ubuntu VPS Setup

At this stage, we are ready with a working apache server which supports PHP. Complex web applications like WordPress will require another system to store data. While there are many database servers to work with, in this series we are going to use MySQL (part of LAMP).

Install MySQL

Pretty straight forward. Just run in a shell:

sudo apt-get install mysql-server

Run installation scripts

Run the following two scripts to install MySQL properly and secure it with root password etc.

sudo mysql_install_db
sudo mysql_secure_installation

Now you should be ready to go.

Install PHPMyAdmin

There are many GUI tools to manage MySQL databases, of them my favorite is PHPMyAdmin. Although Ubuntu repository hosts the latest copy of PHPMyAdmin, we are still going to download the latest version and manually upload it to our server.

  • Go to PHPMyAdmin project page and download the latest version.
  • Unzip it and upload the files to /home/user_name/public_html/phpmyadmin directory.

That’s it. Now navigate to and you should be able to enter username (usually root) and password (the one you have set) to manage your database.

Further Fine Tuning:

To fine tune your MySQL installation, I recommend reading this article at rtCamps. It help you understand the concepts of my.cnf and how to automatically fine tune it.

That was all about MySQL. Coming next is how to setup proftpd to FTP into your server.

Leave a Reply