phpmyadmin

phpmyadmin

前面我们分布部署了lamp 过程在 https://blog.csdn.net/hanyuce/article/details/99095236

php端操作

下载phpMyAdmin压缩包
[root@daxiong ~]# cd /usr/src/
[root@daxiong src]# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip

将包解压到/www/xiaoxiong/下面
[root@daxiong src]# yum -y install unzip
[root@daxiong src]# unzip phpMyAdmin-4.0.10.20-all-languages.zip
[root@daxiong src]# mv phpMyAdmin-4.0.10.20-all-languages /www/xiaoxiong/
[root@daxiong src]# ls /www/xiaoxiong/
index.php  phpMyAdmin-4.0.10.20-all-languages
[root@daxiong xiaoxiong]# ln -sv phpMyAdmin-4.0.10.20-all-languages pma
[root@daxiong xiaoxiong]# ll
总用量 8
-rw-r--r--. 1 root root   24 8月   8 22:45 index.php
drwxr-xr-x  9 root root 4096 8月  10 18:26 phpMyAdmin-4.0.10.20-all-languages
lrwxrwxrwx  1 root root   34 8月  10 18:23 pma -> phpMyAdmin-4.0.10.20-all-languages


复制样本配置文件config.sample.inc.php为config.inc.php
[root@daxiong xiaoxiong]# cd pma
[root@daxiong pma]# cp config.sample.inc.php config.inc.php
[root@daxiong pma]# vim config.inc.php
$cfg['Servers'][$i]['host'] = '192.168.28.130';	   找到此行将他改为数据库主机的地址
[root@daxiong ~]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done

mysql端操作

[root@xiaoxiong ~]# mysql -uroot -p'hyc123!'
mysql> grant all on *.* to pmauser@'192.168.28.%' identified byy 'pmapass';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

httpd端操作

将反向代理目录换为php端需要共享的目录
[root@hyc ~]# vim /etc/httpd24/httpd.conf

    DocumentRoot "/usr/local/apache/htdocs"
    ServerName www.hanyuce.com
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://192.168.28.131:9000/www/xiaoxiong/pma/$1
    
        Options none
        AllowOverride none
        Require all granted
    

[root@hyc ~]# mkdir /usr/local/apache/htdocs/pma
[root@hyc htdocs]# apachectl stop
[root@hyc htdocs]# apachectl start
[root@hyc ~]# ss -antl
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN     0      128     *:22                  *:*                  
LISTEN     0      100    127.0.0.1:25                  *:*                  
LISTEN     0      128    :::80                 :::*                  
LISTEN     0      128    :::22                 :::*                  
LISTEN     0      100       ::1:25                 :::*      

验证

浏览器上使用ip访问,若看到以下界面则表示php成功,否则请检查你的操作
phpmyadmin_第1张图片

你可能感兴趣的:(phpmyadmin)