Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to follow this tutorial http://dev.mysql.com/doc/refman/5.7/en/connector-net-tutorials-asp-roles.html/

Thing is im always running into the same problem. When i change the membership provider to MySQLMembershipProvider i get this error when i click on security.

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.



code for web.config connection


C#
<connectionStrings>
      <remove name="LocalMySqlServer"/>
      <add name="MySqlMembershipProvider" connectionString="server=000.000.000.000;User Id=benoatsc_admin;database=*****;password=****;Persist Security Info=True"
        providerName="MySql.Data.MySqlClient" />
    </connectionStrings>

code for machine.config

C#
<membership defaultProvider="MySqlMembershipProvider">
           <providers>
               <clear/>
               <add name="MySqlMembershipProvider"
                     type="MySql.Web.Security.MySQLMembershipProvider, mysql.web"
                       connectionStringName="Greenfilm"
                       enablePasswordRetrieval="false"
                       enablePasswordReset="true"
                       requiresQuestionAndAnswer="false"
                       requiresUniqueEmail="true"
                       passwordFormat="Hashed"
                       maxInvalidPasswordAttempts="5"
                       minRequiredPasswordLength="6"
                       minRequiredNonalphanumericCharacters="0"
                       passwordAttemptWindow="10"
                       applicationName="/"
                       autogenerateschema="true"/>
           </providers>
       </membership>
       <profile>
         <providers>
           <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
           <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="Greenfilm" applicationName="/" />
         </providers>


I have been at this now for 4 days redoing the same tutorial from over and over, still comes back to the problem.

Thanks

Ben.
Posted

1 solution

Hi Ben,
Your connectionstringName property in providers tag has to be the name that you give in the connection string

eg:
<connectionstrings>
        <remove name="LocalMySqlServer" />
        <add name="MySqlMConnectionString" connectionstring="server=000.000.000.000;User Id=benoatsc_admin;database=*****;password=****;Persist Security Info=True">
          providerName="MySql.Data.MySqlClient" />
   </add></connectionstrings>


<membership defaultprovider="MySqlMembershipProvider">
            <providers>
                <clear />
                <add name="MySqlMembershipProvider"
                      type="MySql.Web.Security.MySQLMembershipProvider, mysql.web"
                        connectionStringName="MySqlMConnectionString"
                        enablePasswordRetrieval="false"
                        enablePasswordReset="true"
                        requiresQuestionAndAnswer="false"
                        requiresUniqueEmail="true"
                        passwordFormat="Hashed"
                        maxInvalidPasswordAttempts="5"
                        minRequiredPasswordLength="6"
                        minRequiredNonalphanumericCharacters="0"
                        passwordAttemptWindow="10"
                        applicationName="/"
                        autogenerateschema="true"/>
            </add></providers>
        </membership>
        <profile>
          <providers>
            <add name="AspNetSqlProfileProvider" connectionstringname="MySqlMConnectionString" applicationname="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </providers></profile>



I think this would solve your problem.
 
Share this answer
 
v4

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