A
A
Andrey2018-09-21 15:59:01
ASP.NET
Andrey, 2018-09-21 15:59:01

ASP .NET Core Web Api How to access external database while debugging?

Good afternoon everyone!
Please tell me, I am creating a web api to work with the mysql database. The base is connected like this:

"DefaultConnection": "Server=192.168.3.10;port=3306;Database=prod;user=service;password=111;charset=utf8"

When debugging (via IIS Express), accessing the database via the web api, I get an error:
"An unhandled exception occurred while processing the request.
ExtendedSocketException: The connection was not established because the destination computer rejected the connection request 192.168.40.1:3306
System. Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) AggregateException
: One or more errors occurred.(Connection failed because destination machine denied connection request 192.168.40.1:3306)
int millisecondsTimeout, CancellationToken cancellationToken)
MySqlException: Unable to connect to any of the specified MySQL hosts.
MySql.Data.MySqlClient.NativeDriver.Open() "
Where does 40.1 come from?
applicationhost.config rules, and in my documents and in the folder with the project, and ran from the admin ... nothing helped :(
Tell me if you come across.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2018-09-21
@EreminD

prosky?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question