A
A
artshelom2020-01-17 22:57:48
MySQL
artshelom, 2020-01-17 22:57:48

How to establish a connection to the database from aspnet?

I'm trying to connect to a free remote database:

"UserConnection": "Server=sql7.freesqldatabase.com,3306;Database=db;User Id=user;Password=psw;",

But when creating it, it gives an error:
InvalidOperationException: Internal connection fatal error.
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, uint waitForMultipleObjectsTimeout, bool allowCreate, bool onlyOneCheckConnection, DbConnectionOptions userOptions, out DbConnectionInternal connection)

How to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2020-01-18
@artshelom

First, you have a fundamentally wrong connection string, second, the server address is passed in the connection string, not the dns name, for connecting via dns, see the last part https://dev.mysql.com/doc/connector-net/en/connect ...

V
Vladimir Korotenko, 2020-01-17
@firedragon

Where is the connection string from?
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question