phpMyAdmin中未显示config.inc.php中指定的服务器

92vpleto  于 2022-12-21  发布在  PHP
关注(0)|答案(3)|浏览(151)

我有这个代码在我的phpMyAdmin配置公司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';

不幸的是,phpMyAdmin UI只显示了两个服务器中的一个,我错过了什么?

3wabscal

3wabscal1#

$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;

为了正常工作,您需要指定auth_type = cookie并定义verbose,它显示您可以从中进行选择以查看详细信息的服务器的名称

ahy6op9u

ahy6op9u2#

您需要为每个服务器添加一个“verbose”键,例如:

$cfg['Servers'][$i]['verbose'] = 'Database Server 2';
fcwjkofz

fcwjkofz3#

/* 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;

相关问题