Installing phpMyAdmin in Ubuntu is fairly easy. It involves using apt-get, determining the web server you want to configure it for, which in this case is apache2 and having the password of the MySQL database user you are configuring it for. You will also have to add a line of code in your apache2 configuration so it knows to include phpMyAdmin it in it’s web server.
So lets get started, let’s begin with installing phpMyAdmin through the terminal.
Type the following line to start installing phpMyAdmin.
sudo apt-get install phpmyadmin
Continue with typing Y once the installation prompts you with Do you want to continue [Y/n]? Like in the image below.
Now we are prompted with selecting our web server, in our case we are selecting apache2 like shown below.
Select <Yes> as we just want a basic installation like shown below.
Enter in your MySQL’s root user password like shown below.
Once again enter in your MySQL’s root user password to confirm it as follows.
Now provide a password for phpMyAdmin to use. So that it can register with the MySQL database itself. (Doesn’t have to be the same as the MySQL root user)
Enter in the phpMyAdmin password you created in last step to confirm it as follows.
phpMyAdmin is now installed if you reach this screen, but we have a few more things to do still.
We now need to include phpMyAdmin in the apache2 configuration file
Lets first open the the file by typing the following line.
sudo vi /etc/apache2/apache2.conf
Press the “Page Down" key on your keyboard or use the arrow keys to go to the very bottom of the configuration file until you see a screen similar to below.
Type in the following line to include phpMyAdmin within the apache2 configuration file.
Once you type in that line above save the file.
Now lets restart apache2 with the following command so that apache2 restarts and applies the edit we just made.
sudo /etc/init.d/apache2 restart
If you end up with screen similar to above with the [ OK ] that means we are good to go! If you ended up with something different it is probably because you misspelled the line we added earlier. Go back and double check that it is indeed correct.
Now we will test phpMyAdmin! Open up a web browser of your choice and browse to:
http://localhost/phpmyadmin/ or http://IPOFYOURSERVER/
Note: Only use localhost if you on that computer at this time or else you won’t see anything as you are browsing locally!
If you end up with a page that has the phpMyAdmin logo we are good to go on.
Now lets login, the default username for phpMyAdmin is root and the password you need is what you selected earlier. Enter as follows.
Password: What you selected earlier
Select Go to login.
You are now logged into your phpMyAdmin through your web browser!
As you can see installing phpMyAdmin in Ubuntu is easy! Remember you can always check out the official phpMyadmin website here for more details.
I have added a gallery below for additional support.