linux7安装phpmyadmin,Centos7 安装 phpMyAdmin 过程

1. 安装 php

yum install php

2. 安装 epel

yum install epel-release

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

3. 安装 phpMyAdmin

yum install phpmyadmin

4. 修改配置文件

vim /etc/httpd/conf.d/phpMyAdmin.conf

将 Require ip xxx 修改为 Require all granted,共4处需要修改,修改后文件如下:

# phpMyAdmin - Web based MySQL browser written in php

#

# Allows only localhost by default

#

# But allowing phpMyAdmin to anyone other than localhost should be considered

# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin

Alias /phpmyadmin /usr/share/phpMyAdmin

AddDefaultCharset UTF-8

# Apache 2.4

# Require ip 127.0.0.1

# Require ip ::1

Require all granted

# Apache 2.2

Order Deny,Allow

Deny from All

Allow from 127.0.0.1

Allow from ::1

# Apache 2.4

# Require ip 127.0.0.1

# Require ip ::1

Require all granted

# Apache 2.2

Order Deny,Allow

Deny from All

Allow from 127.0.0.1

Allow from ::1

# These directories do not require access over HTTP - taken from the original

# phpMyAdmin upstream tarball

#

Order Deny,Allow

Deny from All

Allow from None

# Allow from All

Order Deny,Allow

Deny from All

Allow from None

Order Deny,Allow

Deny from All

Allow from None

# This configuration prevents mod_security at phpMyAdmin directories from

# filtering SQL etc. This may break your mod_security implementation.

#

#

#

# SecRuleInheritance Off

#

#

5. 修改数据库的配置

vim /etc/phpMyAdmin/config.inc.php

修改文件中对应的配置即可。

假如需要配置多个数据库连接,只需要添加多套配置即可。

$i++;

$cfg['Servers'][$i]['auth_type'] = 'cookie';

$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'] = '';

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

$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';

6. 重启服务

systemctl restart httpd

7. 访问

http://ip/phpmyadmin

8. phpMyAdmin 默认安装位置

/usr/share/phpMyAdmin

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值