linux 安装phpMyAdmin
1. 首先安装 php mysql nginx
2. 下载phpMyadmin
wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.0.10/phpMyAdmin-4.0.10-all-languages.tar.gz
tar -zxvf phpMyAdmin-4.0.10-all-languages.tar.gz
3. 配置config文件
mv phpMyAdmin-4.0.10-all-languages phpmyadmin
cd phpmyadmin/libraries/
配置文件地址 phpmyadmin/libraries/config.default.php 配置之前最好备份一下
修改的字段
$cfg['PmaAbsoluteUri'] = 'http://ip:port/phpMyAdmin_path/'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3307'; $cfg['Servers'][$i]['socket'] = '/tmp/mysqld.sock'; //这个可以通过 进入mysql客户端 使用status命令 $cfg['Servers'][$i]['connect_type'] = 'socket'; // 远程主机需要使用tcp $cfg['Servers'][$i]['extension'] = 'mysql'; //看php安装扩展的情况 mysqli or mysql。 $cfg['Servers'][$i]['user'] = 'mysql用户名'; $cfg['Servers'][$i]['password'] = 'mysql密码';
4. 添加新的机器
修改phpMyAdmin/config.inc.php
$i++; $cfg['Servers'][$i]['verbose'] = 'test'; $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = '123456'; $cfg['Servers'][$i]['ssl'] = true; /* Server: localhost [2] */ $i++; $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = 3306; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['nopassword'] = true; $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; /* End of servers configuration */ $cfg['blowfish_secret'] = '54894f14569790.53580465'; $cfg['DefaultLang'] = 'en'; $cfg['ServerDefault'] = 1; $cfg['UploadDir'] = ''; $cfg['SaveDir'] = '';
ps: 官方文档 地址 http://docs.phpmyadmin.net/en/latest/config.html#server-connection-settings