question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MySql connection with .Net Core template error

See original GitHub issue

I have a problem with my connection to MySql database. I generated an app with ASP.NET Core with target version .NET Framework 4.6.1.

My connection string looks like this:

"ConnectionStrings": {
    "Default": "server=localhost;port=xxxx;database=MmpDb;user=user;password=***;" }

I added MySql.Data.Entities references for Mmp.EntityFrameworkCore and Mmp.Web.Host

I overwrite EF DbContext:

public class MmpDbConfiguration : DbConfiguration
     {
         public MmpDbConfiguration()
         {
             SetDefaultConnectionFactory(new MySql.Data.Entity.MySqlConnectionFactory());
             SetProviderServices("MySql.Data.MySqlClient",
                 new MySqlProviderServices());
         }
     }

When I run the command dotnet ef database update I get an error that Keyword not supported: 'port'.

Can somebody provide a solution for this issue please?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ismcagdascommented, Sep 7, 2021

Have you followed https://aspnetboilerplate.com/Pages/Documents/EF-Core-PostgreSql-Integration to convert your app to use Postgres ?

0reactions
sharvari257commented, Sep 2, 2021

I have a problem with my connection to postgreSQL database. I generated an app with Blazor Server app [using syncfusion]

My connection string looks like this:

“ConnectionStrings”: { “MyConnection”: “server=localhost;port=xxxx;database=Blazor;user id=postgres;password=***;trusted_connection=true;” }

the error I am getting is “ArgumentException: Keyword not supported: ‘port’.”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot configure MySql connection with .Net Core template
I have a problem with my connection to MySql database. I generated an app with ASP.NET Core with target version .NET Framework 4.6.1....
Read more >
How To Connect MySQL In ASP.NET Core
NET CORE Application with MySQL and read data from MySQL, using . ... Go to File → New Project → Select Web from...
Read more >
4.3 Handling Connection Errors
NET application. When there is an error connecting, the MySqlConnection class will return a MySqlException object. This object has two properties that are...
Read more >
4.1 Creating a Connector/NET Connection String
The MySqlConnection object is configured using a connection string. A connection string contains several key-value pairs, separated by semicolons.
Read more >
7.2.1 Creating a Database with Code First in EF Core
The Code First approach enables you to define an entity model in code, create a database from the model, and then add data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found