Solved

I need to use MySQL as teh aspNetSQLProvider for forms based authentication

Posted on 2008-06-19
3
866 Views
Last Modified: 2008-06-27
Anyone know how I can go about using MySQL as the database for a an ASPSqlProvider for forms based authentication.  

Typically I would just use the ASP.WebApplication tool to create a provider but it doesnt work out of the box on a MySQL database.
0
Comment
Question by:Prysson
3 Comments
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 21821978
       Hi!

Take a look at these links here and see if they won't help you
http://www.aspdev.org/articles/asp-mysql-connect/
http://www.devarticles.com/c/a/ASP/Using-MyODBC-To-Access-Your-MySQL-Database-Via-ASP/

Regards,
   Tomas Helgi
0
 
LVL 20

Expert Comment

by:brwwiggins
ID: 21822045
0
 

Accepted Solution

by:
Prysson earned 0 total points
ID: 21822535
Hey the solution is here..

http://blog.nolanbailey.com/2008/03/08/mysql-aspnet-membership-and-role-provider/194

This is a GREAT blog entry. Bottom line is that the new MySQL Connector with justa couple tiny adjustments TOTALLY handles the creation of an integrated membership provider. It works like a charm.

Here is tha actual content of the blog entry..I am reposting it in the event that the link ends up being outdated.

MySQL ASP.NET Membership and Role Provider
Posted on March 8th, 2008 by nolan
At this time, there doesnt seem to be a good guide published on setting up your .NET web application to use MySQL as your ASP.NET Membership Provider.

The following worked for me. However, no warranty is expressed or implied.  

Download and install MySQL Connector/Net 5.2.1 or later version.

Add a reference to MySQL.Web to your web application.
C:\Program Files\MySQL\MySQL Connector Net 5.2.1\Web Providers\MySql.Web.dll
Add the autogenerateschema=true attribute. Since the MySQL database schema wasnt automatically created for me, I ended up using the autogenerateschema attribute. The attribute will signal the MySQL provider to build (or upgrade) the database schema.The MySQL 5.2.1 release notes state the following&

Using the new provider schema
=============================
For this release. the only way to upgrade a given server to the new schema is to
add a configuration option for one of your providers. The option is autogenerateschema.
By setting this to true, the provider will silently upgrade the server to the new schema.
Please note that there is no reversing of this procedure so please just do this on test
setups and not on your production systems.

Personally, I found it easiest to just add autogenerateschema=true to my machine.config on my development machine (as opposed to web.config) and its under providers&

<membership>
<providers>
<add name=MySQLMembershipProvider autogenerateschema=true &.
</providers>

Save the changes.

Edit your web applications web.config.

<connectionStrings>
<remove name=LocalMySqlServer/>
<add name=LocalMySqlServer connectionString=Datasource=localhost;Database=DB;uid=Username;pwd=Password; 
providerName=MySql.Data.MySqlClient/> </connectionStrings>



Save the changes.

Build your Web Application.

Now, administer/config your web application.
Under the ASP.NET Web Site Administration Tool provider tab, click Select a Different Provider (advanced) and change the provider to MySQLMembershipProvider.
At this point, you should be able to use MySQL as your ASP.NET Membership and Role Provider (the tables will be automatically built for you).

After the tables are built, youll want to setup your web applications web.config (using your machine.config as a template) so that you will have access to all of the membership provider settings.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp web application 3 43
mysql qry 1 26
c# ftp code 3 35
Fastest way to get file count in MS Server 2012 3 13
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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