root@mail1 ~]# tar zxvf phpMyAdmin-3.4.10.1-all-languages.tar.gz
[root@mail1 ~]# cp phpMyAdmin-3.4.10.1-all-languages /usr/local/apache/htdocs/phpMyAdmin
[root@mail1 ~]# cd /usr/local/apache/htdocs/phpMyAdmin/
[root@mail1 phpMyAdmin]# cp config.sample.inc.php config.inc.php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
#/$cfg['Servers'][$i]['host'] = '192.168.20.204';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
################################################
$i++;
/* Authentication type */
/* Server parameters */
$cfg['Servers'][$i]['host'] = '192.168.20.204'; ------------管理多台MYSQL
[root@mail1 phpMyAdmin]# vi libraries/config.default.php
$cfg['blowfish_secret'] = 'BensonHan';
$cfg['Servers'][$i]['host'] = $_COOKIE["mysqlhost"];
$cfg['Servers'][$i]['host'] = $_COOKIE["mysqlhost"];
$cfg['Servers'][$i]['auth_type'] = 'cookie';
[root@mail1 phpMyAdmin]# vi libraries/auth/cookie.auth.lib.php
<!-- Login form -->
<form method="post" action="index.php" name="login_form"<?php echo $autocomplete; ?> target="_top" class="login">
<fieldset>
<legend>
<?php
echo __('Log in');
echo '<a href="./Documentation.html" target="documentation" ' .
'title="' . __('phpMyAdmin documentation') . '">';
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
echo '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('phpMyAdmin documentation') . '" />';
} else {
echo '(*)';
}
echo '</a>';
?>
</legend>
<?php if ($GLOBALS['cfg']['AllowArbitraryServer']) { ?>
<div class="item">
<label for="input_servername" title="<?php echo __('You can enter hostname/IP address and port separated by space.'); ?>"><?php echo __('Server:'); ?></label>
<input type="text" name="pma_servername" id="input_servername" value="<?php echo htmlspecialchars($default_server); ?>" size="24" class="textfield" title="<?php echo __('You can enter hostname/IP address and port separated by space.'); ?>" />
</div>
<?php } ?>
<div class="item">
<label for="input_username">Server Address:</label>
<input type="text" name="mysqlhost" id="mysqlhost" value="<?=$_COOKIE["mysqlhost"];?>" size="24" class="textfield" />
</div>
<div class="item">
<label for="input_username">MySQL Port:</label>
<input type="text" name="mysqlport" id="mysqlport" value="<?=$_COOKIE["mysqlport"];?>" size="24" class="textfield" />
</div>
在需要管理的MYSQL服务品上看一下/etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
port=3306
点执行
OK 现在 可以管理 远端MYSQL 服务器了