LNMP-部署phpMyAdmin

1、环境准备

1.1、主机准备

nginx+php 192.168.10.5

1.2、软件下载

# 外网的地址
wget https://files.phpmyadmin.net/phpMyAdmin/4.8.4/phpMyAdmin-4.8.4-all-languages.zip

# 国内下载地址
https://softforspeed.51xiazai.cn/down/newdown/3/27/phpMyAdmin-5.0.2-all-languages.zip

2、安装

2.1、解压phpMyAdmin软件

unzip phpMyAdmin-5.0.2-all-languages.zip -d /opt/
chown www -R /opt/phpMyAdmin-5.0.2-all-languages

2.2、配置phpMyAdmin

2.2.1、创建一个管理数据库的管理员帐号

grant all on *.* to 'admin'@'%' identified by 'admin';

2.2.2、配置phpMyAdmin

mv config.sample.inc.php config.inc.php

# 配置数据库的IP地址
] #vi config.inc.php 
$cfg['Servers'][$i]['host'] = '192.168.10.6';

2.3、配置nginx

2.3.1、配置nginx

cat >/etc/nginx/conf.d/phpadmin.conf <<'EOF'
server {
    listen  80;
    server_name phpadmin.cyc.com;
    root /opt/phpMyAdmin-5.0.2-all-languages;
    index index.php index.html;

    location ~ \.php$ {
          try_files $uri =404;
         root /opt/phpMyAdmin-5.0.2-all-languages;
          fastcgi_pass 192.168.10.5:9000;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
     }
}
EOF

2.3.2、测试主机配置hosts

192.168.10.5 phpadmin.cyc.com

2.4、访问测试

2.4.1、这里的帐号和密码是mysql创建的帐号、密码admin

2.4.2、登陆成功

 

posted @ 2023-05-01 16:15  小粉优化大师  阅读(136)  评论(0编辑  收藏  举报