Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28723

MySQL Connector fails to connect to MariaDB

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.4.25, 10.5.16, 10.6.8
    • 10.2.6
    • Protocol
    • None

    Description

      When MySQL Connector/NET is used to connect to a MariaDB database (tested with 10.4, 10.5 and 10.6), the connection fails with a message "Versions of MySQL prior to 5.6 are not currently supported".

      This happens using MySQL.Data.Entity version 8.0.22 or newer.
      Versions 8.0.21 works fine, probably beacause the minimum server version was MySQL 5.0 and MariaDB 10.x is incorrectly identified as MySQL 5.

      I reported the same bug to MySQL.

      I suggest to fix the initial version string, so that MariaDB is recognized as version 10 for example.

      Attachments

        Issue Links

          Activity

            Sample stack trace:

            [NotSupportedException: Versions of MySQL prior to 5.6 are not currently supported]
            MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +520
            System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +115

            [ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
            System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +375
            System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) +92
            System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +63
            System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +225
            System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +213
            System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +957
            System.Data.Entity.Internal.InternalContext.Initialize() +26
            System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +20
            System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +69
            System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
            System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +66
            System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable`1 source, Expression`1 predicate, CancellationToken cancellationToken) +209
            System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable`1 source, Expression`1 predicate) +172
            Microsoft.AspNet.Identity.EntityFramework.<GetUserAggregateAsync>d__67.MoveNext() +489
            System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
            System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
            Microsoft.AspNet.Identity.AsyncHelper.RunSync(Func`1 func) +348
            TaleteWeb.PasswordRecovery.Recupera_OnClick(Object sender, EventArgs e) in C:\TaleteWeb\talete.net\PasswordRecovery.aspx.cs:43
            Telerik.Web.UI.RadButton.OnClick(ButtonClickEventArgs e) +126
            Telerik.Web.UI.RadButton.RaisePostBackEvent(String eventArgument) +299
            System.Web.UI.<ProcessRequestMainAsync>d__523.MoveNext() +9158

            mauro.mazzieri Mauro Mazzieri added a comment - Sample stack trace: [NotSupportedException: Versions of MySQL prior to 5.6 are not currently supported] MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +520 System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +115 [ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.] System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +375 System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) +92 System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +63 System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +225 System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +213 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +957 System.Data.Entity.Internal.InternalContext.Initialize() +26 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +20 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +69 System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21 System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +66 System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable`1 source, Expression`1 predicate, CancellationToken cancellationToken) +209 System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable`1 source, Expression`1 predicate) +172 Microsoft.AspNet.Identity.EntityFramework.<GetUserAggregateAsync>d__67.MoveNext() +489 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62 Microsoft.AspNet.Identity.AsyncHelper.RunSync(Func`1 func) +348 TaleteWeb.PasswordRecovery.Recupera_OnClick(Object sender, EventArgs e) in C:\TaleteWeb\talete.net\PasswordRecovery.aspx.cs:43 Telerik.Web.UI.RadButton.OnClick(ButtonClickEventArgs e) +126 Telerik.Web.UI.RadButton.RaisePostBackEvent(String eventArgument) +299 System.Web.UI.<ProcessRequestMainAsync>d__523.MoveNext() +9158
            danblack Daniel Black added a comment - - edited

            version is a system read only variable that you can set in the configuration file. In the protocol level its doing 5.5.5-10.4.25 however explicitly setting this will correspond the the exact version that MySQL Connector/NET sees.

            danblack Daniel Black added a comment - - edited version is a system read only variable that you can set in the configuration file. In the protocol level its doing 5.5.5-10.4.25 however explicitly setting this will correspond the the exact version that MySQL Connector/NET sees.
            bgrainger Bradley Grainger added a comment - - edited

            MySqlConnector (https://www.nuget.org/packages/MySqlConnector/ ) is routinely tested with MariaDB and is recommended by the MariaDB documentation: https://mariadb.com/kb/en/mysqlconnector-for-adonet/

            It's also much less buggy than MySQL Connector/NET: https://mysqlconnector.net/tutorials/migrating-from-connector-net/#fixed-bugs

            (disclaimer: I'm the lead developer of MySqlConnector)

            Edit: Now I see you're using EF; there's no EF support in MySqlConnector; it can only be used with plain ADO.NET or EF Core.

            bgrainger Bradley Grainger added a comment - - edited MySqlConnector ( https://www.nuget.org/packages/MySqlConnector/ ) is routinely tested with MariaDB and is recommended by the MariaDB documentation: https://mariadb.com/kb/en/mysqlconnector-for-adonet/ It's also much less buggy than MySQL Connector/NET: https://mysqlconnector.net/tutorials/migrating-from-connector-net/#fixed-bugs (disclaimer: I'm the lead developer of MySqlConnector) Edit: Now I see you're using EF; there's no EF support in MySqlConnector; it can only be used with plain ADO.NET or EF Core.

            5.5.5- will removed in MDEV-28910

            serg Sergei Golubchik added a comment - 5.5.5- will removed in MDEV-28910

            People

              serg Sergei Golubchik
              mauro.mazzieri Mauro Mazzieri
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.