---
title: "phpmyadmin管理多台mysql的方法（自用）"
author: "henry2009"
date: "2010-10-13T14:17:38Z"
tags: ["MySQL", "PHP"]
categories: ["编程语言"]
slug: "phpmyadmin-mysql"
draft: false
lastmod: "2010-10-13T14:17:38Z"
id: 783689
url: "https://henry2009.iteye.com/blog/783689"
---

```
$i = 0;
$host_list = array('localhost','192.168.1.xx');
/*
 * First server
 */

foreach($host_list as $i=>$host){
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['host'] = $host;
$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;
$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';

}
```

找到config.default.php，copy 为 config.inc.php到phpmyadmin跟目录，然后加上以上代码。