How To Install phpMyAdmin in Ubuntu / Debian

PhpMyAdmin is a free tool written in PHP developed for giving users the ability to interact with their MySQL databases. It can perform various tasks for administering MySQL such as creating, editing or deleting databases, tables, fields or rows. Also executing SQL statements and managing users and permissions. Most of the operations that you can do via mysql command line client you can do it via phpMyAdmin. And it is available on Ubuntu, Debian and other Linux distros.

Before to install phpMyAdmin you have to make sure that you have LAPM installed – Apache, PHP and MySQL on your Ubuntu server. If you don’t have it you can read Install LAMP Server using Tasksel in Ubuntu.

Here are the steps to install phpMyAdmin on Ubuntu or any other Debian based distribution:

sudo apt-get install phpmyadmin

First you will be asked to choose the web server that should be automatically configured to run phpMyAdmin. Here is the screen shot. Obviously you select Apache 2.
install phpmyadmin on ubuntu

Next question is to create database needed for phpMyAdmin. Click on “Yes”, it will create the required database for phpMyAdmin.
phpmyadmin install ubuntu

In next step you need to provide password for the root user that you have set during MySQL installation. Enter password and click “OK”.
install phpmyadmin on ubuntu

Next step requires to enter password for phpMyAdmin user. Please provide a password for phpmyadmin to register with the database server. If left blank, a random password will be generated. Enter some password for that user and click “OK”.
install phpmyadmin on ubuntu  debian

Final step is to retype the phpmyadmin password and select “OK”.
phpmyadmin ubuntu install on

After that you need to type the following address in your browser http://localhost/phpmyadmin/ or in my case and you will see login screen of phpMyAdmin. You need to provide valid MySQL user and password. So use root for MySQL user and provide password that you setup during the installation process of MySQL.
phpmyadmin login screen

And when login you will see all databases and tables on that MySQL server.
phpmyadmin home screen

With phpMyAdmin you can browse through databases and tables; create, edit, copy, rename, alter and drop databases and tables. You can also perform table maintenance – add, modify and delete fields, execute any SQL-statement, even multiple queries. Also you can perform backup and restore of databases and tables. Via phpMyAdmin you can manage users and privileges of MySQL. PhpMyAdmin support various export formats such as SQL, CSV, XML, Word, Excel, PDF and LaTeX formats. It is a very useful and handy tool. More over it is free and open source. Also you can install it on Ubuntu and Debian via apt-get command.

If you are WordPress user most probably you know that WordPress stores its data into MySQL. So you may need phpMyAdmin to performing maintenance operations on tables, to back up information, and editing data directly in the case that WordPress is not working.

PhpMyAdmin allows you to interact with the database directly. It also lets you mess up the database directly. There is no “undo” or “undelete” in your database. Always exercise caution when working with the database. With great power comes great responsibility, so be careful.