mysql - 无法将 R 连接到托管在 AWS 的 Bitnami 服务器中的 mysql

标签 mysql r wordpress networking amazon-ec2

我对 AWS 和 Wordpress 非常陌生,无法连接到 AWS form Rshiny 中托管的 Bitnami MYSQL 数据库服务器。

我想访问 WordPress 用来存储数据的 Mysql 数据库。 wordpress 是使用 Bitnami 安装并托管在 AWS 中。

AWS详细信息如下:

enter image description here

当我通过 SSH 连接到该 IP 时,我收到带有私有(private) IP 登录名的 BITNAMI 消息:

enter image description here

PHP Myadmin 控制台显示了 wordpress mysql 的以下详细信息:

enter image description here

我已从 AWS 控制台为端口 3306 创建了防火墙规则。入站和出站具有相同的设置并接受来自所有来源的流量:0.0.0.0

现在我已经从上面的 mysql 控制台创建了一个用户并授予其所有访问权限:

CREATE USER 'r_user'@'localhost' IDENTIFIED BY '1234';

GRANT ALL PRIVILEGES ON * . * TO 'r_user'@'localhost';
<小时/>

检索数据

我的 R 服务器托管在 Azure 中,公共(public) IP 为:52.187.238.94

R 代码:

library(RMySQL)
> mydb = dbConnect(MySQL(), user='r_user', password='1234',
> dbname='bitnami_wordpress', host='34.221.144.129', port =3306);

我收到以下错误消息:

> mydb = dbConnect(MySQL(), user='r_user', password='r_gom', dbname='bitnami_wordpress', host='34.221.144.129', port =3306);

Error in .local(drv, ...) : 
  Failed to connect to database: Error: Can't connect to MySQL server on '34.221.144.129' (0)

我看了一些帖子,但无法确定他们是否解决了同样的问题: Can't connect to phpmyadmin in Bitnami instance hosted by AWS

谁能帮我将Mysql服务器连接到R Shiny 吗?

最佳答案

检查 NACL 是否允许端口 3306 用于传入规则。并设置相应的传出规则。

检查安全组规则。

关于mysql - 无法将 R 连接到托管在 AWS 的 Bitnami 服务器中的 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55771491/

相关文章:

r - 如何从 bsts R 包中提取包含概率

php - 在 WooCommerce 中应用优惠券后如何四舍五入价格?

css - Flash 加载缓慢问题

MYSQL auto_increment_增量

regex - 我可以使用 OR 语句来指示 stringr 的 str_extract_all 函数中的模式吗?

mysql - 具有一对多左连接的 SQL 查询排除任何不存在的

r - 配置fix()和edit()以从R/RStudio在Notepad++中打开

php - 在 php 模板中将对象居中。如何?

php - mysql_real_escape_string 与 php 中的单例数据库?

mysql - SQL中有哪些查询字符数限制?