1,解压缩phpmyadmin4.2.8压缩包到/usr/local/phpMyAdmin

2,复制config.sample.inc.php为config.inc.php

3,修改nginx.conf 里

加入 include /usr/local/nginx/conf.d/*.conf; 这段,

http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; gzip on;
include /usr/local/nginx/conf.d/*.conf;

新建conf.d文件夹

新建phpmyadmin.conf如下

server {
listen ;
server_name localhost;
access_log /usr/local/nginx/phpmyadmin-access.log main; location / {
root /usr/local/phpMyAdmin;
index index.php;
} location ~ \.php$ {
root /usr/local/phpMyAdmin;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} location ~ /\.ht {
deny all;
}
}

4,config.inc.php修改为:

 * This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = '123456'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ /*
* Servers configuration
*/
$i = 0; /*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true; /*
* phpMyAdmin configuration storage settings.
*/ /* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = ''; /* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'root';
$cfg['Servers'][$i]['password'] = '';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

  

phpmyadmin nginx设置的更多相关文章

  1. Nginx设置alias别名目录访问phpmyadmin

    引言:Nginx服务器通过设置alias别名可以使特定的目录(phpmyadmin目录)不出现在网站根目录下面,即使网站根目录被攻破,也不会影响到phpmyadmin目录里面的文件. 说明: 站点:h ...

  2. Nginx设置alias实现虚拟目录 alias与root的用法区别

    Nginx 貌似没有虚拟目录的说法,因为它本来就是完完全全根据目录来设计并工作的.如果非要给nginx安上一个虚拟目录的说法,那就只有alias标签比较"像",干脆来说说alias ...

  3. Nginx设置线程数为整机内核数的俩倍!

    Nginx设置线程数为整机内核数的俩倍!

  4. nginx设置不使用缓存 add_header Cache-Control no-cache

    nginx设置不使用缓存 server { listen 443; #域名 server_name www.dev.163.com; #字符集 charset utf-8; ssl on; ssl_c ...

  5. nginx设置SSL反向代理

    Nginx的反向代理通常用来映射内网中提供的Apache.IIS.Lighttpd服务,以实现负载均衡:同时,由于动态服务程序运行在内网,服务器的整体安全性也有所提高,那么怎样用nginx设置SSL的 ...

  6. nginx 设置进程title

    刚好看到nginx设置进程title的源码,因此做一些总结. linux进程实际是以argv[0]处的值来作为进程的title的,因此若需要修改进程的title只需要修改argv[0]处的值即可. 简 ...

  7. Nginx设置Https反向代理,指向Docker Gitlab11.3.9 Https服务

    目录 目录 1.GitLab11.3.9的安装 2.域名在阿里云托管,申请免费的1年证书 3.Gitlab 的 https 配置 4.Nginx 配置 https,反向代理指向 Gitlab 配置 目 ...

  8. Nginx设置网站维护页面

    网站升级需要停服,可以在Nginx设置静态页面设置强制跳转 修改nginx配置文件nginx.conf http { sendfile on; keepalive_timeout 65; server ...

  9. Nginx 设置临时维护页面

    Nginx 设置临时维护页面 http://www.myexception.cn/open-source/1753957.html http://blog.justwd.net/snippets/ng ...

随机推荐

  1. ARM内核版本号和SOC版本号

    原博:https://blog.csdn.net/wxywxywxy110/article/details/78764988 内核版本号                   SoC版本号        ...

  2. leecode第二百零六题(反转链表)

    /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode ...

  3. 2018 German Collegiate Programming Contest (GCPC 18)

    2018 German Collegiate Programming Contest (GCPC 18) Attack on Alpha-Zet 建树,求lca 代码: #include <al ...

  4. ST MCU_GPIO的八种工作模式详解。

    补充: N.P型的区别,就是一个为正电压启动(NMOS),一个为负电压启动(PMOS) GPIO的八种工作模式详解 浮空输入_IN_FLOATING带上拉输入_IPU带下拉输入_IPD模拟输入_AIN ...

  5. spring boot扫描mapper文件

    一个简单的功能,百度查的都是XX,谷歌万岁. 因为扫描不到自动生成的mapper就无法注入到service 方案一.@Mapper 如果Mapper文件所在的包和你的配置mapper的项目的pom定义 ...

  6. MVC模式和MVP模式的区别

    MVC模式: 1. MVC的所有通信都是单向的. 2. view传送指令到controller(用户也可以直接将指令传到controller). 3. controller完成业务逻辑后要求model ...

  7. 多进程—进程同步控制,IPC

    multiprocessing包—Process模块开启多进程的两种方式,Process的方法,守护进程 进程同步控制—multiprocessing.Lock  multiprocessing.Se ...

  8. 一直又爱又恨的jqueryValidate,看到一个还不错的laber.error样式

    默认样式,不是很好看 修改之后就高大上多了 功臣如下: label.error {    position: absolute;    right: 18px;    top: 5px;   colo ...

  9. Mybatis 搭建遇到的坑

    1. <?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC " ...

  10. Eureka的使用

    一.项目配置文件:application.yml #------ eureka配置,默认不开启,如需使用rest负载模式需开启 start ------------- eureka: instance ...