Solved

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

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Creating and Managing Databases with phpMyAdmin in cPanel.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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