阅读背景:

ASP.NET核心连接字符串 - 使用AWS RDS

来源:互联网 

I would like to switch from using a local db in my web app, to aws relation databases (RDS).

我想从我的Web应用程序中使用本地数据库切换到aws关系数据库(RDS)。

I have connected to the aws RDS via mysql workbench.

我通过mysql workbench连接到aws RDS。

In order to make this switch, all I have changed is the connection string. But it doesn't work. (it hangs for 30 seconds then throws HTTP Error 502.3 - Bad Gateway).

为了进行此切换,我所做的只是连接字符串。但它不起作用。 (它挂起30秒然后抛出HTTP错误502.3 - 坏网关)。

the local db: =Server=localhost;database=ef3;uid=root;pwd=123456;

本地db:= Server = localhost; database = ef3; uid = root; pwd = 123456;

But when I change it to Server=test2.xxx.ap-southeast-2.rds.amazonaws.com;database=test2;uid=xx;pwd=xx;port=3306;, I get the following output from the console. https://pastebin.com/raw/qA0py6t0

但当我将其更改为Server = test2.xxx.ap-southeast-2.rds.amazonaws.com; database = test2; uid = xx; pwd = xx; port = 3306;时,我从控制台获得以下输出。 https://pastebin.com/raw/qA0py6t0

The last line says: "Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware","{OriginalFormat}":"An unhandled exception has occurred while executing the request"}}}

最后一行说:“Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware”,“{OriginalFormat}”:“执行请求时发生了未处理的异常”}}}

How do I fix the connection string, to connect to the AWS RDS? Thanks guys

如何修复连接字符串以连接到AWS RDS?多谢你们

1 个解决方案

#1


1  

The connection seems fine, seems like that database doesn't contain the expected data.

连接似乎很好,似乎该数据库不包含预期的数据。

From the trace:

从追踪:

MySql.Data.MySqlClient.MySqlException: Table 'test2.Events' doesn't exist

MySql.Data.MySqlClient.MySqlException:表'test2.Events'不存在


分享到: