Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is the Ubuntu way to configure phpMyAdmin so that I can use it to administer multiple MySQL servers? The database parameters are set in /etc/dbconfig-common/phpmyadmin.conf, but there's only space in there for the connection parameters for a single server. I could hack it into /etc/phpmyadmin/config-db.php and /etc/phpmyadmin/config.inc.php, but I assume there has to be a more elegant way.

share|improve this question
    
Have you ever found a sollution to do this? Did you hack into one of the files you've mentioned, or not? –  Nanne Mar 31 '11 at 9:41
add comment

4 Answers

I think this is the most accurate way to do it:

First setup the password:

sudo htpasswd -c /etc/phpmyadmin/htpasswd.setup admin

Then disable security:

sudo pma-configure

Then go to http://yourserver/phpmyadmin/setup (here the browsers ask for auth, the user is admin and the password is what you write in first command), with that wizard you configure your servers, once is done, put the security again:

sudo pma-secure
share|improve this answer
add comment

I have assumed the following:

  • /etc/phpmyadmin/ would be the most logical place to add the config
  • /etc/phpmyadmin/config-db.php is the location for the default (local?) config. This is, because it is a default, one db only
  • /etc/phpmyadmin/config.inc.php reads the default database so it has one. At least this one is used, so you have a database. If something changes in your config, the config-db.php is changed, so 'local' changes to your file are not modified

Therefore my conclusion was that adding an extra server below this part:

/* Configure according to dbconfig-common if enabled */
if (!empty($dbname)) {
    //reading from config-db.php
}

//$i++ was allready done in if above
//Adding extra servers
 $cfg['Servers'][$i]['host'] = 'serverhost.host.tld';
 $cfg['Servers'][$i]['extension'] = 'mysqli';
//...etc

This looks like the best place.

share|improve this answer
add comment

According to the phpMyAdmin documentation you can define multiple servers in the $cfg['Servers'] array defined in the config.inc.php file.

share|improve this answer
2  
In a generic phpMyAdmin install, yes. But Ubuntu has its own configuration files to generate that part of the config.inc.php file, and I want to know the Ubuntu way to configure it, without having to override the Ubuntu configuration. –  Mike Scott Jan 4 '11 at 9:57
    
I see. The comments in the file say You can regenerate it using: dpkg-reconfigure -plow phpmyadmin. I assume you tried that? (won't do it on production system now) Other than that ... manually changed files should be prompted on update before being overwritten. –  Carsten Thiel Jan 4 '11 at 10:06
2  
Yes, I can regenerate the file config-db.php, but the config file from which it sources the database connection parameters (/etc/dbconfig-common/phpmyadmin.conf) only has room to configure one database server. I want to know how to configure more than one database server. –  Mike Scott Jan 4 '11 at 10:21
add comment

This tutorial explains how you can manage multiple MySQL servers from one phpMyAdmin installation. For security reasons, communication between phpMyAdmin and any remote MySQL server is using SSL encryption

share|improve this answer
2  
That doesn't tell me how to do it using the Ubuntu way of configuring it, so it doesn't answer the question at all. –  Mike Scott Sep 21 '12 at 10:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.