如果要管理多个数据库,方便切换,可以在phpMyadmin里直接配置多个数据库
选择即可跳转到相应的数据库
要注意,这是明文保存密码在配置文件里的,所以需要注意安全
复制一份 config.sample.inc.php 为 config.inc.php
可以看到这个是基于cookie来验证登录的
我们可以改为config方式,并且加上用户名和密码
把user和password配置好即可
复制多个即可增加多个server,同时访问phpMyadmin会出现下拉选择框,选择即可跳转到另外的数据库
原创内容如转载请注明:来自 阿权的书房
选择即可跳转到相应的数据库
要注意,这是明文保存密码在配置文件里的,所以需要注意安全
复制一份 config.sample.inc.php 为 config.inc.php
/**
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
可以看到这个是基于cookie来验证登录的
我们可以改为config方式,并且加上用户名和密码
/**
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'user';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'user';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
把user和password配置好即可
复制多个即可增加多个server,同时访问phpMyadmin会出现下拉选择框,选择即可跳转到另外的数据库
原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘