phpMyAdmin图形化管理监控

一. 运行环境:
lnmp 或者lamp
phpmyadmin不同版本对php和mysql的版本有相对应的要求
具体可以去官网查看:https://www.phpmyadmin.net/files/

二. 安装

  1. 下载 :
    https://files.phpmyadmin.net/phpMyAdmin/4.8.3/phpMyAdmin-4.8.3-all-languages.zip
  2. 解压到web的根目录,并且重命名为phpmyadmin
    unzip phpMyAdmin-4.8.3-all-languages.zip
    mv phpMyAdmin-4.8.3-all-languages phpmyadmin
  3. 复制配置文件
    cd /var/www/html/phpmyadmin
    cp config.sample.inc.php config.inc.php
  4. http://192.168.4.55/phpmyadmin 访问登录测试
    到此安装结束,接下来设置登录方式

三. 设置登录方式和管理多个数据库服务器

  1. 如何设置phpMyAdmin自动登录?
    打开config.inc.php 找到 $cfg['Servers'][$i]['auth_type'],将
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    改成
    $cfg['Servers'][$i]['auth_type'] = 'config'
    然后在下面追加如下代码:
    $cfg['Servers'][$i]['user']          = 'root';      // 设置的mysql用户名
    $cfg['Servers'][$i]['password']      = '123456';    // 设置的mysql密码
  2. 如何取消phpMyAdmin自动登录
    只需把
    $cfg['Servers'][$i]['auth_type'] = 'config';
    改成
    $cfg['Servers'][$i]['auth_type'] = 'cookie';

温馨提示:
$cfg['Servers'][$i]['auth_type'] 有三个待选项值,即 cookie、http、config。用的比较多的是 cookie与config。当在正式环境时,用 cookie,要求用户必须输入正确的用户名与密码,而在本地测试服务器时,一般用 config,省得session失效后又得输入用户名与密码,以节省开发时间

  1. 登陆phpMyAdmin时输入服务器ip地址端口、用户名、密码
    只需要在phpmyadmin的配置文件 config.inc.php 中加上一个配置项
    $cfg['AllowArbitraryServer'] = true;
    这样登录界面会多出服务器一项 不填的话默认使用配置文件中的服务器 指定端口只需在服务器地址后加一个空格再加上端口即可,是不是很简单呢^^
  2. 只需输入用户名、密码,服务器地址为下拉列表可选
    修改config.inc.php文件,找到 First server 注释部分,将其修改为以下内容
    $hosts = array(
    '1'=>array('host'=>'localhost','user'=>'root','password'=>'123456'),
    '2'=>array('host'=>'192.168.0.1','user'=>'ciray','password'=>'123456')
    );
    //$hosts数组下标从1开始,host的值为服务器ip地址,user是对应的MySql登陆用户名,password的值为MySql的登陆密码,请修改成你自己的
    //$hosts数组配置了两台服务器,如果你有多台服务器,请按数组下标递增的顺序添加配置信息
    /*
    * First server
    */
    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]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysql';
    $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';
    }

修改完成后保存文件,重新登陆,如果可以看到phpMyAdmin登陆界面中出现服务器候选列表,说明修改正确.

phpMyAdmin图形化管理监控

如需开启高级功能,参考:https://blog.csdn.net/joshua_317/article/details/51363471

大功告成,还可以监控mysql
phpMyAdmin图形化管理监控
phpMyAdmin图形化管理监控

转载于:https://blog.51cto.com/lingxudong/2326283

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值