Question

How do I add phpmyadmin to two different vhosts?

Posted September 25, 2015 3k views
ApachePHP 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer
apt-get install phpmyadmin
Submit an Answer