2

我需要通过 PHP MyAdmin 访问 Amazon RDS。由于我是初学者,我真的很挣扎。我发现了一个类似问题的帖子: 使用 PHPMyAdmin 管理 Amazon RDS 指向: http ://blog.benkuhl.com/2010/12/how-to-remotely-manage-an-amazon-rds-instance-with -phpmyadmin/

那里的答案只是弄乱了我完整的 config.inc.php 文件。我必须重新安装包括 PHPMyAdmin 在内的 XAMPP 才能再次访问本地主机。

有人可以告诉我最好的方法是什么吗?我可以从本地 PHPMyAdmin 访问 Amazon RDS 是否正确?

谢谢

编辑:已经看到文件中的代码需要以

$i++;

有人知道代码最终应该是什么样子吗?

添加:

$cfg['Servers'][$i]['auth_type'] = 'HTTP';
    $cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = 'xxxxx.l2kj35ncj3.us-east-1.rds.amazonaws.com';

没有为我工作。

编辑2:我在以下位置找到文件是否正确:“/Applications/XAMPP/xamppfiles/phpmyadmin”

我的 config.inc.php 文件看起来与教程中的不同。

<?php

/* $Id: config.sample.inc.php,v 2.1.2.2 2006/08/28 08:14:14 nijel Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:

/**
 * phpMyAdmin sample configuration, you can use it as base for 
 * manual configuration. For easier setup you can use scripts/setup.php
 *
 * All directives are explained in Documentation.html and on phpMyAdmin 
 * wiki <http://wiki.cihar.com>.
 */

/* 
 * This is needed for cookie based authentication to encrypt password in 
 * cookie
 */
$cfg['blowfish_secret'] = ''; /* 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'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['connect_type'] = 'socket'; 
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
//$cfg['Servers'][$i]['controluser'] = 'pmauser';
//$cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* Advanced phpMyAdmin features */
//$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';

/* 
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>
4

1 回答 1

0

听起来您的 RDS 实例所属的数据库安全组中可能没有您的本地 IP 地址。

转到 AWS 管理控制台的 RDS 部分。

在页面的左侧,单击“数据库实例”。选择您尝试访问的实例并记下它属于哪个安全组。

现在,在页面的左侧,单击“数据库安全组”。选择您记下的安全组。页面底部应该有一个显示 CIDR 的表单字段。在它下方,您将看到本地机器的 CIDR 的最佳估计值。将其复制并粘贴到 CIDR 框中,然后单击添加按钮。

现在尝试从本地计算机访问数据库。

于 2013-06-07T01:18:35.880 回答