Solved

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

Posted on 2008-06-19
3
869 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 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