PhpMyAdmin is a handy web interface for managing local MySQL databases, and can make database queries, management and backups easy.
In this tutorial, I’m going to talk you through installing PhpMyAdmin on your Raspberry Pi powered web server. I’m assuming you’ve got Raspbian installed, and you’ve followed my tutorial: install Apache, PHP and MySQL on Raspberry Pi.
Step 1 – Begin the PhpMyAdmin installation
From terminal, we begin by changing to the root user in terminal by entering:
sudo bash
Now we need to install the PhpMyAdmin package using:
apt-get install phpmyadmin
The package will begin installing. You will be asked which web server is installed, choose apache2.
My screenshots show purple, but you’ll see blue. I’ve already got PhpMyAdmin installed on my Raspberry Pi so had to install it on a ubuntu VM for the purpose of this tutorial – apologies for the wrong colours, but I can assure you the procedure is the same for Debian/Raspbian and Ubuntu!
Step 2 – configure for dbconfig-common
Next we’ll need to configure PhpMyAdmin’s database. You’ll see the following prompt:
When prompted, choose Yes. Next you’ll be asked for an administrative password, this is the root password that was set during the MySQL installation in the previous tutorial.
You’ll be asked to set a password for PhpMySQL. I’ve used the same password as the MySQL root password, but its up to you what you set here. Make a note of it somewhere.
That’s PhpMyAdmin installed. Next we need to change the apache configuration to allow us to use http://your.raspberrypi.domain/phpmyadmin to access it.
Step 3 – Configure Apache to work with PhpMyAdmin
We need to alter the Apache configuration in order to access PhpMyAdmin. To do this, enter the following command to alter the configuration:
nano /etc/apache2/apache2.conf
The configuration file will load in Nano. Navigate to the bottom of the file (keep pressing CTRL + V to jump page by page until you’re at the bottom of the file) and add the following new line to the file:
Include /etc/phpmyadmin/apache.conf
Save the file (CTRL + X and enter Y when prompted to save) and restart Apache2. To restart Apache, enter the following command:
/etc/init.d/apache2 restart
That’s it! You’re all installed and ready to go. Give accessing it a try by going to your Raspberry Pi’s IP address or domain name and add ‘/phpmyadmin’ to the end in your web browser, ie http://your.raspberrypi.domain/phpmyadmin. 
As always your comments are welcome, feel free to leave one below. My next tutorial will guide you through installing WordPress through terminal, and hosting your first WordPress site on your Raspberry Pi web server.
I installed phpmyadmin on raspberry pi but left frame is not displayed (navigations.php)
You think you can help me with this problem?
thanks.
Hi Ion
It looks like a file is missing from your installation. From terminal type:
Is there a ‘navigation.php’ there? If not, I’ll zip mine up and give instruction on how to import this into your installation.
the navigation.php file is present but i dont know why not displayed
I looked in the html source and navigation.php file is not included
Are you using chrome? If you are, right click anywhere on the phpMyAdmin page and click ‘inspect element’. Click on ‘console’ and let me know if there are any errors or missing files. Failing that we could look at repairing your installation, but that wouldn’t tell us what’s not working.
Thanks very much for the help on this Dingleberry Pi. You rock. Who did your header image? It’s pretty rad.
Peace,
Dr H
Why thank you Dr! Glad you like the site and found it to be beneficial. I did the header image, it was done in Adobe Fireworks
I cannot log in.I never put password but i dunno why i cannot log in.With password also can not log in.Can you help.
use root as username
I have installed apache2, mysql, php and myadmin as per your instructions (I thinbk) and got the phpmyadin screen displaying. What username and password are being asked for though – I tried pi with the password I selected for phpmyadmin and mysql and get error sannot connect to mysql … am pretty sure the error is just wrong username …. what name should i be using?
use: root, as username
Thank you for the excellent tutorials; they certainly saved me a huge amount of research time.
It is amazing what this little machine can do.
Got to the part where we were supposed to add
Include /etc/phpmyadmin/apache.conf
pressed CTRL+X and then Y and got a message
“Error writing /etc/phpmyadmin/apache.conf: permission denied
Is there a way to resolve this issue? I don’t know anything about Linux… But so far your tutorials have made it easy!
Hi there.
Did you start with ‘sudo bash’, this essentially lets you do things with elevated privlages, so should allow you to write the file.
Try ‘sudo nano /etc/apache2/apache2.conf’ instead of ‘nano /etc/apache2/apache2.conf’ and you should be able to make the change to the file. Any problems, leave another message and I’ll help how I can.
Ok this time it let me save the file but after typing in the line to restart Apache a bunch of text comes up that reads
“syntax error on line 43 of /etc/phpmyadmin/apache.conf”
Says the same thing probably 100 times over and over… At the bottom it says
“Action ‘configtest’ failed.
The apache error log may have more information.
failed!” (red font)
Before when I couldn’t save the file I could still reach the Apache server by going to its IP address on another computer but now it is not finding it… Because of this error I would assume… Is it how I edited the file? I did exactly as you said, key-down to the bottom of the file then insert the following
” Include /etc/phpmyadmin/apache.conf”
So the last 3 lines looks something like this
.
.
.
# Include the virtual host configurations:
Include sites-enabled/
Include /etc/phpmyadmin/apache.conf (What I added)
Got it all figured out! Now I’m just waiting for your next tutorial, how to install WordPress
Just waiting for the next tutorial “how to install WordPress”
Me too, I would love to get a website like one you have here! It’s exceptional and I hope I’ll be able to have something like this someday! Thanks for the great work so far!! Keep it coming, for all of us Ste W
At some point I must have accidentally went into ‘phpmyadmin/apache.conf’ and added: Include /etc/phpmyadmin/apache.conf
Right thing to add but wrong file… Once I discovered this, deleted the line, and rebooted my pi it seems to work!!!
My next problem is at phpMyAdmin is the username ‘pi’ I keep trying this and it produces an error #1045 I don’t recall you having me set up another username…
Try username: root
I’m getting a 403 error when trying to access phpmyadmin. Any ideas?
The PMA install worked out of the box for me on a Lighttpd server, but if you are having trouble with it, here are some tips for lighty users…
http://ideamonk.blogspot.fi/2010/09/setting-up-lighttpd-phpmyadmin-etc.html
So i followed your tutorials, but when i go to the website “jgpallo.zapto.org/phpmyadmin” it shows nothing, just an empty page with an error saying the page could not be found.
I am getting the same problems~!
Perfect, followed step by step and not 1 issue!!!! I am up and running in minutes!!
Hello,
Thanks for the tutorial! Everything went smoothly, except it never asked me for a password. So when I try to login as the root user obviously it doesn’t work. Do you have any suggestions? Is there a way to reset the password possibly?
Thanks,
Nick