Unable to initialize provider. Missing or incorrect schema. for MySql.Web connector
Asked Answered
V

5

8

I am trying to use MySql Connector 6.2.2.0 for membership and role providers.

The issue I'm having is: Unable to initialize provider. Missing or incorrect schema.

<authentication mode="Forms"/>
<roleManager defaultProvider="MySqlRoleProvider"
    enabled="true"
    cacheRolesInCookie="true"
    cookieName=".ASPROLES"
    cookieTimeout="30"
    cookiePath="/"
    cookieRequireSSL="false"
    cookieSlidingExpiration="true"
    cookieProtection="All" >
  <providers>
    <clear />
    <add
        name="MySqlRoleProvider"
        type="MySql.Web.Security.MySQLRoleProvider, MySql.Web,
        Version=6.2.2.0,Culture=neutral, PublicKeyToken=c5687fc88969c44d"   
        connectionStringName="mySQL"
        applicationName="capcafe"
        writeExceptionsToEventLog="true"
    />
  </providers>
</roleManager>
<membership defaultProvider="MySqlMembershipProvider">
   <providers>
      <add connectionStringName="mySQL" 
         applicationName="capcafe" 
         minRequiredPasswordLength="5"
         requiresQuestionAndAnswer="false" 
         requiresUniqueEmail="false"
         minRequiredNonalphanumericCharacters="0" 
         name="MySqlMembershipProvider"
         type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.2.2.0,
         Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
   </providers>
</membership>

Here is the line it doesn't seem to like:

Line 57:             type="MySql.Web.Security.MySQLRoleProvider, MySql.Web,
Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"

I have both MySql.Web and MySql.Data referenced and in my bin! Any help resolving this issue will be very much appreciated.

Vannavannatta answered 6/3, 2010 at 16:13 Comment(0)
K
13

Add references to the assemblies, add autogenerateschema="true" attribute to both as:

<providers>
<remove name="MySQLProfileProvider"/>
<add name="MySQLProfileProvider" autogenerateschema="true" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/"/>
</providers>

use ASP.Net configuration tool.

Kristeenkristel answered 19/3, 2010 at 17:2 Comment(1)
Just wanted to add, the autogenerateschema="true" MUST come before the 'type' declaration. I had it after and I was still getting the error. Once I but it before, it started working.Ezana
G
3

I had this problem, it turned out there was no password in my connection string, I think checking carefully that your connection string is correct would be a good place to start.

Guard answered 17/4, 2010 at 17:6 Comment(0)
C
3

My problem was I had "localhost" in my connection string instead of the IP address of the webhost's MySQL server.

Once I changed that in my web.config file it worked fine, so you need to check your web.config file very carefully.

Clyte answered 22/12, 2010 at 14:17 Comment(0)
C
2

I was experiencing this exact same issue. Mine ended up being a case issue since I was deploying my site to a linux server running Mono. Enabling autogenerateschema="true" helped me figure this one out. Some hosts won't let the code generate the necessary tables though, so if it doesn't auto-generate your schema then check out casing issues.

Cozart answered 24/3, 2011 at 20:2 Comment(0)
R
1

CodeMonkey's solution worked for me... I was actually deploying a new app to a Win 2008 Server VM. The schema could not be generated until I specified the LocalMySql connection string and set the MySQLRoleProvider autogenerate to true.

Roper answered 15/2, 2013 at 21:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.