phpMyAdmin无需填写IP管理多个MySQL实践

《phpMyAdmin无需填写IP管理多个MySQL实践》

前言

默认安装phpMyAdmin,通常只能连一台MySQL服务器,其配置信息是保存在phpMyAdmin的配置文件里的,当我们需要在多台服务器之间进行切换登陆的时候,修改起来非常麻烦。遵照下面的配置方法,我们可以方便的使用phpMyAdmin连接多台MySQL。

用phpMyAdmin简化MySQL数据库管理工作

更新历史

2015年08月19日 – 增加Adminer,感谢@BOYPT推荐
2015年08月12日 – 初稿

阅读原文 – http://wsgzao.github.io/post/phpmyadmin/

扩展阅读

配置phpmyadmin使登录时可填写IP管理多台MySQL – http://www.oicto.com/phpmyadmin-mysql-ip/
phpMyAdmin – http://docs.phpmyadmin.net/
LTMP索引 – http://wsgzao.github.io/index/#LTMP

下载文件

1.从官方下载最新的版本
http://www.phpmyadmin.net/downloads/

2.解压上传至服务器中

3.PHP环境搭建可以参考以下文章

LTMP手动编译安装以及全自动化部署实践 – http://wsgzao.github.io/post/ltmp/

方法1

phpMyAdmin允许定义输入的MySQL服务器IP地址,用户名和密码

修改/libraries/config.default.php为真即可,简单安全省事

 $cfg['AllowArbitraryServer'] = true;

方法2

phpMyAdmin修改config.inc.php,服务器地址为下拉列表可选登录多个服务器

增加config.sample.inc.php文件,参考下面配置或者访问setup手动生成

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 4.4.11 setup script
 * Date: Fri, 10 Jul 2015 15:54:42 +0800
 */

/* Servers configuration */
$i = 0;

/* Server: 10.4.14.64 [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '10.10.6.64';
$cfg['Servers'][$i]['host'] = '10.10.6.64';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

/* Server: 10.10.1.172 [2] */
$i++;
$cfg['Servers'][$i]['verbose'] = '10.10.1.172';
$cfg['Servers'][$i]['host'] = '10.10.1.172';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

/* End of servers configuration */

$cfg['blowfish_secret'] = '559f78c86f22d8.48481095';
$cfg['DefaultLang'] = 'zh_CN';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>

方法3

不多说了,直接看官方的对比报告吧,感谢@BOYPT推荐

Adminer – http://www.adminer.org/

Why is Adminer better than phpMyAdmin?

Replace phpMyAdmin with Adminer and you will get a tidier user interface, better support for MySQL features, higher performance and more security. See detailed comparison.

Adminer development priorities are: 1. Security, 2. User experience, 3. Performance, 4. Feature set, 5. Size.

http://www.adminer.org/en/phpmyadmin/

    原文作者:王奥OX
    原文地址: https://segmentfault.com/a/1190000003110901
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞