Click here to Skip to main content
15,358,946 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Projcet in MVC &

This is the full error message:

System.Data.Entity.Core.ProviderIncompatibleException: 'An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See for information on DbContext and connections. See the inner exception for details of the failure.'

I tried since yesterday to solve it without any result!

Here is the connectionStrings:

  <add name="PioneerDBContext"
       connectionString=" Server=localhost; Port=3306; DataBase=MYDB; username=root; password=;"
       providerName="MySql.Data.MySqlClient" />

and here is the Context class:

Imports System.Data.Entity
Imports System.Collections.Generic

Public Class PioneerDBContext
    Inherits DbContext

    Public Property Projects As DbSet(Of Project)
    Public Property Items As DbSet(Of Item)
    Public Property Suppliers As DbSet(Of Supplier)
    Public Property POs As DbSet(Of PO)
    Public Property Users As DbSet(Of User)
    Public Property Companyinfos As DbSet(Of Companyinfo)

End Class

I can not get where is the mistake?

What I have tried:

A lot of solutions in net not working with me !
Updated 5-May-22 17:42pm
CHill60 22-Mar-22 10:53am
What is in the inner exception?
Majid Farhan 22-Mar-22 10:57am
1-ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.

2-NotSupportedException: Versions of MySQL prior to 5.6 are not currently supported
CHill60 22-Mar-22 11:00am
So there you are using an out of date version of mysql for the driver you are trying to use
Majid Farhan 22-Mar-22 12:26pm
Thanks a lot I don't know why I was thinking the inner exception about Mysql NuGet version!

1 solution

OP confirmed that he was using out-of-date mysql version and hence was facing it.

[Posting to pop it out of unanswered queue]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900