【问题标题】:phpmyadmin for RDSRDS 的 phpmyadmin
【发布时间】:2012-03-08 22:48:54
【问题描述】:

在aws dev论坛上询问并没有找到解决方案后,我决定在这里放一个AWS相关的Q。

我也按照重复问题here中给出的步骤进行操作

谁能告诉我我在哪里做错了。

我的 EC2 实例位于 us-west-1c (linux) 中,并安装了 phpmyadmin。 我的 RDS 也在 us-west-1c 我的 EC2 和 RDS 通用的安全 grp 配置了 http/ssh/mysql 端口。

我可以使用 php 中的 mysql_connect() 从我的实例连接到我的 rds, 但如果我将我的 rds 端点作为 phpmyadmin (config.inc.php) 中的主机,它不会响应。

这就是我的 config.inc.php 的样子

$cfg['Servers'][$i]['host'] = 'xx.amazonaws.com';

$cfg['Servers'][$i]['port'] = '3306';

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

$cfg['Servers'][$i]['connect_type'] = 'tcp';

$cfg['Servers'][$i]['extension'] = 'mysql';

$cfg['Servers'][$i]['compress'] = true;

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

$cfg['Servers'][$i]['user'] = 'xxx';

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

我在这里错过了什么吗?

非常感谢您

【问题讨论】:

    标签: amazon-ec2 phpmyadmin amazon-rds


    【解决方案1】:

    您必须在 httpd conf 中允许外部连接:

    sudo nano /etc/httpd/conf.d/phpmyadmin.conf
    

    更新为:

    <Directory "/usr/share/phpmyadmin">
      Order Deny,Allow
      Allow from all
    </Directory>
    

    然后重启apache

    sudo service httpd restart
    

    只需要在phpmyadmin/config中更新以下内容

    sudo nano /usr/share/phpmyadmin/config.inc.php
    
    $cfg['blowfish_secret'] = 'somerandomtext';
    $cfg['Servers'][$i]['host'] = 'xxx-your-service-host.rds.amazonaws.com';
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2014-12-12
      • 2011-05-23
      • 2023-03-08
      • 2013-05-30
      • 2020-08-27
      • 2017-05-10
      • 1970-01-01
      • 2016-06-07
      • 2020-08-07
      相关资源
      最近更新 更多