4

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

 2 years ago
source link: https://wsgzao.github.io/post/phpmyadmin/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
phpMyAdmin 无需填写 IP 管理多个 MySQL 实践

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

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


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

阅读原文 - https://wsgzao.github.io/post/phpmyadmin/

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


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

  2. 解压上传至服务器中

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

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

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

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

$cfg['AllowArbitraryServer'] = true;

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'] = '';
?>

不多说了,直接看官方的对比报告吧,感谢 @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/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK