一. 运行环境:
lnmp 或者lamp
phpmyadmin不一样版本对php和mysql的版本有相对应的要求
具体能够去官网查看:https://www.phpmyadmin.net/files/php
二. 安装html
unzip phpMyAdmin-4.8.3-all-languages.zip mv phpMyAdmin-4.8.3-all-languages phpmyadmin
cd /var/www/html/phpmyadmin cp config.sample.inc.php config.inc.php
三. 设置登陆方式和管理多个数据库服务器mysql
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config'
$cfg['Servers'][$i]['user'] = 'root'; // 设置的mysql用户名 $cfg['Servers'][$i]['password'] = '123456'; // 设置的mysql密码
$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失效后又得输入用户名与密码,以节省开发时间 web
$cfg['AllowArbitraryServer'] = true;
$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登录界面中出现服务器候选列表,说明修改正确.sql
如需开启高级功能,参考:https://blog.csdn.net/joshua_317/article/details/51363471数据库
大功告成,还能够监控mysql数组