下面在lamp基础上部署phpmyadmmin,查看lamp请前往
lamp
环境说明:
服务器类型 | ip地址 | 应用 | 操作系统 |
---|---|---|---|
httpd | 172.16.195.125 | httpd | centos7/redhat7 |
mysql | 172.16.195.126 | mysql | centos7/redhat7 |
phpl | 172.16.195.127 | phpphpmyadmin | centos7/redhat7 |
php服务端操作:
下载phpMyAdmin压缩包
[root@php qqq]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip
解压在/www/qqq目录下
[root@php qqq]# yum -y install unzip
[root@php qqq]# unzip phpMyAdmin-4.0.10.20-all-languages.zip
inflating: phpMyAdmin-4.0.10.20-all-languages/view_operations.php
inflating: phpMyAdmin-4.0.10.20-all-languages/webapp.php
建立软连接
[root@php qqq]# ln -sv phpMyAdmin-4.0.10.20-all-languages pma
"pma" -> "phpMyAdmin-4.0.10.20-all-languages"
复制样本配置文件config.sample.inc.php为config.inc.php
[root@php qqq]# cd pma
[root@php pma]# cp config.sample.inc.php config.inc.php
[root@php pma]# vim config.inc.php
$cfg['blowfish_secret'] = 'chenqian123'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 加上随机码用于通信加密
$cfg['Servers'][$i]['host'] = '172.16.195.126'; 修改为数据库主机的地址
重启服务
[root@php pma]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm done
mysql服务端操作:
在mysql主机上授权用户
[root@mysql ~]# mysql -uroot -pchenqian123!
mysql> grant all on *.* to pmauser@'172.16.195.%' identified by 'pmapass';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
httpd服务端操作:
[root@apache ~]# mkdir /usr/local/apache/htdocs/pma