How do I add phpmyadmin to two different vhosts?

September 25, 2015 2.9k views
Apache PHP Frameworks


I am able to use phpmyadmin on one virtual host but sometimes i need to enable my other site and access phpmyadmin there but it doesn’t work. I disable the first site, enable the second site, restart apache2.

How do I add phpmyadmin to my second site?

  • Note that phpMyAdmin can be used to access any database on the server regardless of which site it’s installed on. All that matters to phpMyAdmin and MySQL is the MySQL username and password you use to log in to phpMyAdmin. So, you might consider using a single phpMyAdmin install. You could even put it on its own subdomain like

  • I guess I don’t understand why it works with one virtual host file and not the other.
    I a2dissite site.conf then a2ensite site2.conf restart apache2 and phpmyadmin or phppgadmin appear but on the first site they both work. Should I just leave both sites enabled at the same time?

    Thank you for your reply.

1 Answer
apt-get install phpmyadmin
Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!