2

I have this code in my phpMyAdmin config.inc.php:

/* Server 1 */
$i++;
$cfg['Servers'][$i]['host']       = 'server1.com:3306';
$cfg['Servers'][$i]['user']       = 'user1';
$cfg['Servers'][$i]['password']   = 'passwd1';
$cfg['Servers'][$i]['auth_type']  = 'config';

/* Server 2 */
$i++;
$cfg['Servers'][$i]['host']       = 'server2.com:3306';
$cfg['Servers'][$i]['user']       = 'user2';
$cfg['Servers'][$i]['password']   = 'passwd2';
$cfg['Servers'][$i]['auth_type']  = 'config';

Unfortunately, phpMyAdmin UI shows only one of the two servers. What am I missing here?

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
coderodde
  • 1,269
  • 4
  • 17
  • 34
  • 1
    Do you net see a dropdown called "Server Choice" on the phpMyAdmin login screen? Just under where you enter the Username and Password – RiggsFolly Jun 11 '20 at 12:28
  • @RiggsFolly No. It still shows me only one server. – coderodde Jun 11 '20 at 12:32
  • So do you see a dropdown on the phpMyAdmin home page top left under the row of little icons? – RiggsFolly Jun 11 '20 at 12:35
  • @RiggsFolly In fact, I do, but a server is still missing. – coderodde Jun 11 '20 at 12:40
  • Have you tried the whole list ? If one of those works considering marking the question as duplicate. If they don't work then I see nothing wrong with yoru code and the problem might be coming from elsewhere. https://stackoverflow.com/questions/42007881/configure-phpmyadmin-with-multiple-databases-and-http-auth – Alexandre Elshobokshy Jun 23 '20 at 08:49

3 Answers3

1
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose']   = 'no1';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['port'] = 3306;


$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose']   = 'no2';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '10.9.8.1';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['port'] = 3306;

In order to work you need to specify the auth_type = cookie and define verbose which show the name of the server where you can select from in order to view the detials

0

You need to add a 'verbose' key for each of your servers, e.g.:

 $cfg['Servers'][$i]['verbose'] = 'Database Server 2';
Thunder Rabbit
  • 5,405
  • 8
  • 44
  • 82
Jonathan Delean
  • 1,011
  • 1
  • 8
  • 25
0
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'svr2.mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/*
* Second server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'svr3.mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/*
* Third server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'svr4.mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;