小编Kar*_*pan的帖子

尽管设置了入站规则,仍无法连接到 AWS RDS

我正在使用 AWS RDS,我想远程连接到数据库。然而,我不断得到

Database connection failed due to connection to server at 
"mydb.12345.eu-central-1.rds.amazonaws.com" (x.xx.xxx.xx),
port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?
Run Code Online (Sandbox Code Playgroud)

这些似乎是一个非常常见的问题,所有解决方案都建议应将入站规则设置为接受来自您自己的 IP 的所有流量。

然而,对我来说这并不能解决问题。

这是我的设置:

在此输入图像描述

这些是安全组中的入站规则sg-650cbe0b

在此输入图像描述

我还尝试添加入站规则,例如:

在此输入图像描述

或者

在此输入图像描述

但这没有用。

我尝试通过移动网络进行连接(以查看是否是防火墙问题),但出现了相同的错误。

不过,我从 AWS Lambda 函数内访问该数据库,并且没有任何问题。

这是我用来访问数据库的代码:

Database connection failed due to connection to server at 
"mydb.12345.eu-central-1.rds.amazonaws.com" (x.xx.xxx.xx),
port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-rds

5
推荐指数
1
解决办法
5575
查看次数

尽管使用了区域设置文件,但在 moment.js 中设置区域设置不起作用

setLocale项目的依赖项中有一个方法,我在区域设置更改时从项目中调用该方法。但是,区域设置似乎没有改变。

import moment from 'moment';
import 'moment/locale/de'; 

export const setLocale = locale => {
    console.log(`Locale to be set: ${locale}`)
    moment.locale(locale);
    console.log(moment.locale())
};
Run Code Online (Sandbox Code Playgroud)

控制台输出

moment-js v2.26.0在依赖项和2.24.0主项目中使用。

如果我明确设置区域设置,也会发生同样的情况。

但是,在主项目中更改区域设置效果很好。

javascript momentjs reactjs

0
推荐指数
1
解决办法
9170
查看次数