How do I add phpmyadmin to two different vhosts?

September 25, 2015 1.6k views
Apache PHP Frameworks

Hello,

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?

2 comments
  • 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 phpmyadmin.yourdomain.com.

  • 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
Have another answer? Share your knowledge.