Error Connecting to a remote Windows MYSQL Windows server using Windows ASP.NET

25 views Asked by At

I have two EC2 servers running in AWS. Server A and Server B. Both are windows 2019. Server A is running a simple MVC ASP.Net program and Server B is running MySQL 5.7. I can connect to the MYSQL server using SQLYog using the private IP address of B from A. So far, every thing is correct.

When I try to connect using the ASP.NET program from server A, it throws the exception. A partial stack trace is given below.

When the MYSQL server runs locally in A or in an Amazon MYSQL RDS DB, it works fine. Bottom line I don't see any issue with the ASP.NET program or MySQL settings. It is only when I try to connect from A to B, it throws error.

Error Message starts below.

The Local Security Authority cannot be contacted Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: The Local Security Authority cannot be contacted

[AuthenticationException: A call to SSPI failed, see inner exception.]

I tried googling the issue and could not find the problem for MYSQL. Every thing checks out fine because I can connect to the server B from server A using SQLYug. I can also connect to the MYSQL server using my ASP.NET program when it's running locally or remotely in Amazon RDS server. I checked the Windows firewall in server B and it allows port 3306.

0

There are 0 answers