MySql connection with .Net Core template error
See original GitHub issueI 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:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have you followed https://aspnetboilerplate.com/Pages/Documents/EF-Core-PostgreSql-Integration to convert your app to use Postgres ?
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’.”