配置phpMyAdmin连接多实例MySQL

cp config.sample.inc.php config.inc.php
vim config.inc.php

/**
 * First server
 */
//$i++;
/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'master.rds.aliyun.com';
//$cfg['Servers'][$i]['compress'] = false;
//$cfg['Servers'][$i]['AllowNoPassword'] = false;

$hosts = array(
  '1' => array('host'=>'master.rds.aliyun.com', 'port'=>3306),
  '2' => array('host'=>'slave.rds.aliyun.com', 'port'=>3306)
);

for ($i=1; $i<=count($hosts); $i++) {
  /* Authentication type */
  $cfg['Servers'][$i]['auth_type'] = 'cookie';
  /* Server parameters */
  $cfg['Servers'][$i]['host'] = $hosts[$i]['host'];  //修改host
  $cfg['Servers'][$i]['port'] = $hosts[$i]['port']; 
  $cfg['Servers'][$i]['connect_type'] = 'tcp';
  $cfg['Servers'][$i]['compress'] = false;
  /* Select mysqli if your server has it */
  $cfg['Servers'][$i]['extension'] = 'mysqli';
  //$cfg['Servers'][$i]['AllowNoPassword'] = true;
  //$cfg['Servers'][$i]['user'] = $hosts[$i]['user'];  //修改用户名
  //$cfg['Servers'][$i]['password'] = $hosts[$i]['password'];  //密码
  /* rajk - for blobstreaming */
  $cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
  $cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
  $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
  $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
}
上一篇 curl测试dns解析时间及tcp连接时间
下一篇 隐藏Nginx版本号的方法
目录
文章列表
1 PM2入门
PM2入门
2
Firebase推送通知服务端实现
Firebase推送通知服务端实现
3
MySQL与Java交互时毫秒处理
MySQL与Java交互时毫秒处理
4
Vue.js 移动端 UI 组件库 YDUI
Vue.js 移动端 UI 组件库 YDUI
5
微信小程序实现摇一摇功能
微信小程序实现摇一摇功能
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。