Beep
Beep

Reputation: 2823

Membership and rolls through visual studios 2012 MySql

I am trying to set membership and rolls through visual studios 2012 using my live hosted MySQL database.

I have been following this tutorial .

After trying a few times, I am getting stuck on this one part where I run Web Site Administration Tool and keep getting the same error when I click on the security tab

error

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: Type is not resolved for member 'MySql.Data.MySqlClient.MySqlException,MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=******'.*

My code is following

machine.config code

 <membership>
      <providers>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=*******" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
        <add name="MySQLMembershipProvider" autogenerateschema="true" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=***********" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
      </providers>
    </membership>

web.config code

 <connectionStrings>
<remove name ="LocalMySqlServer"/>
<add name="LocalMySqlServer"
     connectionString="Datasource=000.000.00.000;Database=******;uid=******;pwd=*******;"
     providerName="MySql.Data.MySqlClient"/>

I am not sure of what is the cause of this error. What i am missing here?

Upvotes: 1

Views: 239

Answers (1)

Pavel Kutakov
Pavel Kutakov

Reputation: 971

If you can run your application - just do it and see actual database related error. As for me it was not existing database. I manually created the database and only after that went on with "Web Site Administration Tool" successfully. And check connection string format. My looks like

Server=localhost;Database=xxxx;Uid=yyyy;Pwd=zzzz; 

Hope this helps

Upvotes: 1

Related Questions