Solved

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

Posted on 2008-06-19
3
861 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 24

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 5 124
php image upload 3 27
MySQL ERROR 1045 (28000) 2 41
install app on other machine 13 18
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Creating and Managing Databases with phpMyAdmin in cPanel.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

11 Experts available now in Live!

Get 1:1 Help Now