1,在CentOS7安装epel源,(原服务器上要有php环境以及php的进程管理器php-fpm)
yum -y install epel-release

2,安装phpMyAdmin软件
yum -y install phpmyadmin

3,为了使Nginx Web服务器正确地查找和提供phpMyAdmin文件,我们只需要创建一个从安装文件到我们的Nginx文档根目录的符号链接:
ln -s /usr/share/phpMyAdmin /usr/share/nginx/html

4,配置nginx,如下图

5,重新启动我们的PHP处理器,以确保它可以加载我们安装的额外的PHP模块:
systemctl restart php-fpm

6,这样,我们的phpMyAdmin安装现在可以运行。 要访问该界面中,转至服务器的域名或公网IP地址,后跟/phpMyAdmin ,在网页浏览器
http://server_domain_or_IP/phpMyAdmin

7,我们可以授权我们的mysql数据库服务器对外远程访问
登录mysql数据库
msyql -uyourusername -pyoupassword
mysql > grant all privileges on . to yourMysqlUser@'%' identified by 'your password';
mysql > flush privileges;
mysql > exit;

8,测试并验证

9,若是有多个需要连接的数据库,可以修改phpMyAdmin的配置文件,修改根目录/etc/phpMyAdmin中的config.inc.php配置
$i = 0;

/*

  • 服务器A
    /
    $i++;
    /
    Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['port'] = '3307';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '123456';
    $cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
    $cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
    $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
    $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/*

  • 服务器B
    */
    $i++;
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['port'] = '3308';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = ‘123456';
    $cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
    $cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
    $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
    $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/*

  • 服务器C
    */
    $i++;
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['port'] = '3306';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '123456';
    $cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
    $cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
    $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
    $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
    保存,打开phpmyadmin,在首页就可以看到服务器列表了

10,可参考内容如下
https://www.howtoing.com/how-to-install-and-secure-phpmyadmin-with-nginx-on-a-centos-7-server

转载于:https://blog.51cto.com/13718210/2335177

CentOS 7服务器上使用Nginx+phpMyAdmin相关推荐

  1. 阿里云服务器上安装nginx

    转自:https://blog.csdn.net/u014209205/article/details/78921870 在阿里云服务器上安装nginx中遇到一些问题,现将步骤罗列下, 环境是:cen ...

  2. 阿里云/腾讯云服务器上部署Nginx,域名,SSL证书

    你将会从这篇文章中学到: 在服务器上部署Nginx. 域名的购买. 添加域名,让域名解析到你的服务器上. 教你如何添加SSL证书. 在你的服务器上面配置Nginx,实现http和https的访问. 如 ...

  3. 搭建远程linux,如何在远程Linux服务器上搭建Nginx?

    1.将nginx的压缩包nginx-1.8.0.tar.gz上传到Linux服务器 2.由于nginx是C语言开发的并且我们这里是通过编译nginx的源码来安装nginx,所以Linux上要安装C语言 ...

  4. 宝塔面板部署vue项目到云服务器上(Nginx服务器)

    前言: 之前使用终端安装nginx,后来崩了 因为自己宝塔也安了 后来服务器重装 决定只用宝塔的nginx部署 步骤: 1.填加站点 2.第一行随便写一行域名 后面删掉就行 第二行ip:端口 php版 ...

  5. 记录第一次成功将vue项目打包并部署到centos云服务器上并访问(包含多个vue项目部署nginx配置说明)

    文章目录 准备 vue项目打包 配置服务器 使用xshell 使用xftp 当项目更新时操作 小结 准备 vscode:用于打包vue项目(需要提前安装好node与npm,推荐使用mvn管理node, ...

  6. 在CentOS 6.8上安装Nginx

    本文主要记录在CentOS 6.8版的Linux环境下安装Nginx的操作流程,具体步骤如下: 步骤一:到Nginx官网上下载软件,http://nginx.org/en/download.html ...

  7. ubuntu 14.04服务器上使用nginx搭建wordpress博客详解

    过程详解 1.更新apt-get sudo apt-get update 2.安装nginx sudo apt-get install nginx 3.启动nginx sudo service ngi ...

  8. Linux服务器上使用nginx搭建mp4、flv流媒体服务器

    因为是编译安装,所以需要系统中装有gcc相关的包. 需要用到的源码包有nginx-1.0.4.tar.gz(http://nginx.org/download/nginx-1.0.4.tar.gz). ...

  9. 如何服务器上查找nginx网站目录下,查看nginx安装目录和版本的多种方法、命令详细介绍...

    Nginx安装目录在哪儿,版本时多少?有时候我们接受了一个别人配置的Nginx Web服务器,首先想确认这些基本信息.其实可以查看Nginx安装目录和安装版本的方法/命令有好多种.(注意:以下命令有的 ...

最新文章

  1. python http 身份认证简介
  2. mysql 360怎么安装_MySQL安装方法
  3. shiro(1) 介绍
  4. 可访问性不一致 可访问性低_什么是网站可访问性?
  5. 下拉刷新和UITableView的section headerView冲突的原因分析与解决方案
  6. OpenCV-绘制旋转矩形
  7. 搬水果 - 九度教程第31题(哈夫曼树)
  8. CMDN创新应用推荐:泊车伴侣Parkbud
  9. 关于我的大学ACM江湖
  10. Win10开始菜单打不开
  11. 浅析2022年6月六级翻译真题
  12. 解决删除chrome注册表残留问题
  13. 二叉树的构造(前序+中序)---(后序 + 中序)
  14. ubuntu20.04中安装Flatpak,切换数据源
  15. docker自定义elasticsearch镜像——集成中文分词器smartcn
  16. C++ 11 特性:关联容器map、set的使用
  17. 【面经】陌陌-2017年8月28日,散招实习生
  18. ASP.NET MVC的SNS软件Spacebuilder
  19. oracle对日期字符串动态分区,oracle 11g分区表新特性---interval分区 的坑
  20. 微型计算机怎么安装系统,实战移动设备安装Windows操作系统

热门文章

  1. L1-076 降价提醒机器人 (10 分)-PAT 团体程序设计天梯赛 GPLT
  2. 监控系统故障定位之事件关联分析的设计
  3. perl 哈希(hash) 学习笔记
  4. Linux基础命令---accept打印机控制
  5. Choerodon猪齿鱼敏捷管理实践(一)——需求管理
  6. 【转】使用CSS 禁止文本选择
  7. mysql之delete删除记录后数据库大小不变
  8. struts2 在拦截器进行注入(依据Action是否实现自己定义接口)
  9. JAVA接口继承、抽象类等
  10. 企业运维之域控篇(三)--加入域