环境说明:
系统版本:CentOS 6.6 32bit
软件版本:mysql 5.6.25 、nginx1.6.2 、 php5.4.37 LNMP架构
说明:mysql5.5版本以上需要使用phpmyadmin4.4版本以上;
步骤如下:
# unzip phpMyAdmin-4.4.7-all-languages.zip
# mv phpMyAdmin-4.4.7-all-languages/* /usr/local/nginx/html/phpmyadmin/
# cd /usr/local/nginx/html/phpmyadmin/
# cp config.sample.inc.php config.inc.php
浏览器访问 192.168.20.5/phpmyadmin
使用root用户,密码为mysql密码登录;
报错如下图:无法登录MySQL服务器;
出现这个错误,表示没有连接到数据库
解决方法:
# vi config.inc.php
找到这一行 $cfg['Servers'][$i]['host'] = 'localhost';
修改为:$cfg['Servers'][$i]['host'] = '127.0.0.1';
重新连接就登录进去了;
nginx虚拟主机配置如下:
# cat /usr/local/nginx/conf/vhosts/default.conf
server
{
listen 80;
server_name 192.168.20.5;
index index.html index.htm index.php;
root /usr/local/nginx/html;
location ~ .php$ {
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
php-fpm配置如下:
# cat /usr/local/php/etc/php-fpm.conf
[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
[www]
user = php-fpm
group = php-fpm
listen = /tmp/php-fcgi.sock
listen.mode = 0666
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
LAMP架构协同应用的实例——phpMyAdmin http://www.linuxidc.com/Linux/2013-07/87645.htm
LAMP应用之phpMyAdmin、Wordpress http://www.linuxidc.com/Linux/2013-04/82757.htm
phpMyAdmin老出现登陆超时解决方法 http://www.linuxidc.com/Linux/2012-09/70715.htm
Ubuntu 安装phpMyAdmin与Adminer http://www.linuxidc.com/Linux/2012-08/69419.htm
在LAMP基础上实现SSL功能并安装phpMyAdmin http://www.linuxidc.com/Linux/2012-07/66905.htm
Ubuntu 14.04 配置 LAMP+phpMyAdmin PHP(5.5.9)开发环境 http://www.linuxidc.com/Linux/2014-10/107924.htm
phpMyAdmin 的详细介绍:请点这里
phpMyAdmin 的下载地址:请点这里
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。