Solved

MySQL ASP.Net Membership Provider

Posted on 2009-04-13
4
1,115 Views
Last Modified: 2012-05-06
I am trying to implement the Membership provider in ASP.Net and not having an easy time going about this. There are several tutorials I have followed in detail however I must be missing something.

Both of the Following Tutorials are to my understanding using the same technique in modifying the Machine.Config file to get ASP.net's Dev Server Config Tool to be able to see the MySql Connector.

Heres my checklist
1.) I am programming in asp/Vb.Net VS2005
2.) I uninstalled my latest copy of DotNet Connector and installed the 5.2.2.0 as requested in the tutorial.
3.) I have copied the requested DLL's(Mysql.web.dll and mysql.data.dll) into a Bin folder within my webapps directory.
4.) I have added a Connection string in my Web.Config File as follows
***See Code Section (Web.Config)
5.) I have changed the authentication mode to "Forms"
6.) I have modified my Machine.config
***See Code Section (Machine.Config)

The Problem i am getting is when I open the 'Asp.net Configuration Tool' and click on the 'Security' tab I get the following 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. Unable to initialize provider. Missing or incorrect schema.

I am unsure where to go from here. I am quite new to ASP.net although i've been a console programmer for a number of years. I have never used the membership provider and wanted to learn about it, however at my company we exclusively use MySQL.

Any suggestions or help will be greatly appreciated it. I've spent the last week trying to get this implemented and I'm about ready to give up and just do roles management without using these nice controls provided out of the box by Visual Studio.

Referenced Tutorials
http://xspgroup.wordpress.com/2008/09/09/aspnet-authorization-authentication-with-mysql/
http://www.codeproject.com/KB/database/mysqlmembershipprovider.aspx
-Web.Config

<connectionStrings>

    <remove name="LocalMySqlServer"/>

    <add name="LocalMySqlServer" connectionString="Server=MyIP; Database=POSUtil; Uid=root; Pwd=MyPW;" providerName="MySql.Data.SqlClient" />

  </connectionStrings>

 

-Machine.Config

  <system.web>

    <processModel autoConfig="true" />

    <httpHandlers />

    <membership defaultProvider="MySqlMembershipProvider">

      <providers>

        <clear/>

        <remove name="MySqlMembershipProvider"/>

        <add name="MySQLMembershipProvider" autogenerateschema="true" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />

      </providers>

    </membership>

    <profile>

      <providers>

        <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />

      </providers>

    </profile>

    <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=5.2.2.0, Culture=neutral,PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" writeExceptionsToEventLog="false" />

      </providers>

    </roleManager>

  </system.web>

Open in new window

0
Comment
Question by:tk6077
  • 2
4 Comments
 
LVL 15

Expert Comment

by:deepaknet
ID: 24135976
There is a good wrapper here http://www.codeproject.com/KB/database/mysqlmembershipprovider.aspx

Can you check out?
0
 

Author Comment

by:tk6077
ID: 24137778
Unfortunately I've had no luck getting this class set to work. Its the second link I've provided in my referenced tutorials section. I understand the concept in this tutorial however it doesn't work for me. I am using MySQL v.4 which the author of that tutorial stated has problems loading the schema. So I have set up my own tables in accordance with the format layed out in the SQL statements to no avail.
0
 

Accepted Solution

by:
tk6077 earned 0 total points
ID: 24185568
I gave up trying to get the built in DotNet controls to work and just made my own. It would be nice to use them I just don't have the kind of time required to keep messing with it.
0
 

Expert Comment

by:manitou2215
ID: 26180369
If you ever have time to research this again, the following video series / associated tutorials really helped get me started with asp.net membership:

www.asp.net/learn/security-videos/

0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now