Install phpMyAdmin on Ubuntu

phpMyAdmin is a web based GUI tool written in PHP for administering MySQL servers. This guide assumes that LAMP (Linux, Apache, MySQL, PHP) is already installed, and MySQL server is populated with databases (i.e. not empty).

To set up a virtual machine running Ubuntu with Apache, MySQL and PHP, read the following blog posts first:


To install phpMyAdmin 3.4.5deb1, please ensure the following pre-requisites are met:

  • A web server – apache2 will suffice for Ubuntu 11.10
  • PHP 5.2.0 or newer
  • MySQL 5.0.1 or newer

Open the Terminal and issue the following commands to verify:

$ apache2 -version
$ mysqld -V
$ php -v

Install phpMyAdmin

$ sudo apt-get update
$ sudo apt-get install phpmyadmin

You will see the following message:

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
dbconfig-common php5-gd
The following NEW packages will be installed:
dbconfig-common php5-gd phpmyadmin
0 upgraded, 3 newly installed, 0 to remove and 139 not upgraded.
Need to get 5,736 kB of archives.
After this operation, 20.2 MB of additional disk space will be used.
Do you want to continue [Y/n]?

Answer ‘Y’ to initiate the installation.

Then follow the prompt to make the correct selections.

  • web server to reconfigure automatically: apache2
  • configure database for phpmyadmin with dbconfig-common: No (this assumes you have existing databases)

If there are no existing databases, answer Yes to configure a database for phpmyadmin with dbconfig-common. Then for the next two prompts, enter the same MySQL user password (use an account with administrative access privilege), i.e. in response to the following:

  • Password of the database’s administrative user
  • MySQL application password for phpmyadmin

Add phpMyAdmin apache config

$ sudo nano /etc/apache2/apache2.conf

Scroll down until you find the include module section, and add the following line and save the file:

Include /etc/phpmyadmin/apache.conf

Restart the apache web server for the above changes to take effect

$ sudo service apache2 restart

Open a web browser and enter the following URL:


Log into phpMyAdmin web based tool using one of your MySQL server user. Your existing databases should all be there.

Congratulations! You have successfully set up phpMyAdmin 3.4.5 on Ubuntu Server 11.10.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s