你好,游客 登录 注册 搜索
背景:
阅读新闻

phpMyAdmin 安装配置手册

[日期:2017-05-25] 来源:Linux社区  作者:215687833 [字体: ]

首先安装php,需要php版本大于等于5.6
CentOS 6.5的epel及remi源。
# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

以下是CentOS 7.0的源。
# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

使用yum list命令查看可安装的包(Packege)。
# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

安装PHP5.6

yum源配置好了,下一步就安装PHP5.6。

# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

用PHP命令查看版本。
[root@Xxxxxx 15:13:48 ~]# php -v
# /etc/init.d/php-fpm restart
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]

安装nginx:
yum install nginx

修改nginx的配置文件
# cat /etc/nginx/conf.d/admin.conf 
server
{
    listen 80;
    server_name _;
    index  index.html index.php;
    root /data;
    location ~ .*\.php$ {
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

注释:$document_root 这个nginx变量取的是root的值。

安装Mysql服务:
这块已经封装好的直接rpm安装好后,启动Mysql服务,登录Mysql授权:
mysql> grant all privileges on *.* to 'root'@'%' identified by 'password';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

下载PhpMyAdmin 软件配置PhpMyAdmin配置文件.

首先将已经下载的
phpMyAdmin-4.7.0-all-languages.tar.gz

解压phpMyAdmin压缩包重新命名.
tar zxf phpMyAdmin-4.7.0-all-languages.tar.gz
mv phpMyAdmin-4.7.0-all-languages phpMyAdmin

注释:将phpMyAdmin移动到nginx root目录下.

修改PhpMysqlAdmin的配置文件:
vim /data/phpMyAdmin/libraries/config.default.php

#修改为自己浏览器登录访问的url.
$cfg['PmaAbsoluteUri'] = 'http://172.16.2.24/phpMyAdmin/';

#cookie的加密密码,防止模拟cookie破解,自己定义.
$cfg['blowfish_secret'] = '1qaz@WSX';

#Mysql server的ip
$cfg['Servers'][$i]['host'] = '172.16.2.24';

#Mysql的端口.
$cfg['Servers'][$i]['port'] = '3306';

#基于cookie认证的方式,默认为cookie.
$cfg['Servers'][$i]['auth_type'] = 'cookie';

#用户随便给,登录phpMyAdmin 用Mysql授权的账户和密码就能登录
$cfg['Servers'][$i]['user'] = 'root';

#密码随便给,登录phpMyAdmin 用Mysql授权的账户和密码就能登录
$cfg['Servers'][$i]['password'] = '123456';

#允许root登录,默认开启.
$cfg['Servers'][$i]['AllowRoot'] = true;

#关闭无密码登录,默认为关闭.
$cfg['Servers'][$i]['AllowNoPassword'] = false;

#修改PhpMysqlAdmin登录默认的语言.
$cfg['DefaultLang'] = 'zh';

重启php程序:
# /etc/init.d/php-fpm restart
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]

访问浏览器:http://172.16.2.24/phpMyAdmin/

用户/密码:Mysql 授权的用户和密码

网上很多资料说需要cp一份config.sample.inc.php 为config.inc.php,修改里面一些参数,根本不需要。

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 16.04安装phpMyAdmin数据库管理工具  http://www.linuxidc.com/Linux/2016-11/137483.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 的下载地址请点这里

本文永久更新链接地址http://www.linuxidc.com/Linux/2017-05/144216.htm

linux
相关资讯       phpMyAdmin配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款