Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-19
3
Medium Priority
?
870 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

688 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