Linux安装配置PHPmyadmin

进官网下载zip安装包

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip

安装解压工具

yum install unzip –y

解压安装包

unzip unzip phpMyAdmin-5.0.1-all-languages.zip

把解压好的文件移动到/www/phpMyAdmin下面

mv phpMyAdmin-5.0.1-all-languages/* /www/phpMyAdmin/

cd /www/phpMyAdmin

复制重命名一份配置文件

cp config.sample.inc.php config.php

进入/etc/nginx/conf.d

创建一个配置文件phpMyAdmin.conf

添加以下代码

server {
      listen       880;
      server_name  localhost;
      root /www/phpMyAdmin;
      location / {
          index  index.php index.html index.htm;
      }
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
      location ~ \.php$ {
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
          include        fastcgi.conf;
      }
}

在/etc/nginx/nginx.conf中引入配置文件

(include conf.d/phpMyAdmin.conf;)

在服务器中打开安全组端口,浏览器中输入相应的ip:880进入登录页面

cd /www/phpMyAdmin/

cp libraries/config.default.php config.inc.php

vim config.inc.php

端口号改为3306

$cfg['Servers'][$i]['port'] = '3306';

修改root密码:

$cfg['Servers'][$i]['password'] = '******';

修改为本地地址

$cfg['Servers'][$i]['host'] = '127.0.0.1';

重启php服务器

systemctl restart php-fpm

然后就能访问PHPmyadmin数据库了

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值