Mysql会员/角色提供者 [英] Mysql membership/role provider
问题描述
我没有成功连接到MySql数据库以获得asp.net会员资格。我有一个空的数据库,当我使用ASP配置工具时,我得到的消息是没有指定提供者。有人可以建议什么有用吗?这是我在web.config中的连接字符串和成员资格部分。
I have no success in connecting to MySql database for asp.net membership. I have an empty database, and when I use the ASP Configuration tool I get the message that no providers are specified. Can someone suggest what works? Here is my connection string and membership section in the web.config.
<connectionStrings>
<add name="MySqlMembershipConnection"
connectionString="server=localhost;user id=root;persistsecurityinfo=True;password=bobby;database=bsgdb;"
providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear/>
<add name="MySqlMembershipProvider"
type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
connectionStringName="MySqlMembershipConnection"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
applicationName="/"
autogenerateschema="true"/>
</providers>
</membership>
我尝试过:
我尝试过所有可以找到的东西。什么都行不通。我没有在我的machine.config中更改任何内容,因为一个来源建议。我不知道它在哪里。我正在使用Windows 7.
What I have tried:
I have tried everything that I can find. Nothing works. I have not changed anything in my machine.config as one source suggested. I don't know where it is. I am using Windows 7.
推荐答案
您需要设置数据库和应用程序本身。
请参阅 MySQL :: MySQL Connector / Net开发人员指南:: 4.2教程:MySQL Connector / Net ASP.NET成员资格和角色提供程序 [ ^ ]
You need to setup the database and the application itself.
See MySQL :: MySQL Connector/Net Developer Guide :: 4.2 Tutorial: MySQL Connector/Net ASP.NET Membership and Role Provider[^]
我和其他很多人一起使用了它。但似乎所有人都缺少一些东西。我终于找到了正确的版本号以及该类型的公钥。经过几次更改后,我生成了表格,但是出现了一些错误。然后,一些更改终于使它工作。我想知道是否有人在那里有所有正确的指令和web.config让它第一次工作。我发现的很多东西都没用。但是有一篇文章的答案足够接近。我发布的配置信息是正确的,它的工作原理。我不确定最终解决了什么问题。也许冰镇啤酒有效。
感谢您的帮助。现在我已经创建了数据库并且可以连接,我将尝试在另一个项目中使用它。现在我将尝试找到一种方法让网站管理工具在VS 2013中运行!我正在使用VS 2010,遇到MySql困难。
I used that along with lots of others. But there seemed to be something missing from all of them. I finally found the right version number along with the public key for the type. After a few more changes I generated the tables, though some errors popped up. Then a few more changes finally got it working. I wonder if someone out there has all the proper instructions and web.config to get it to work the first time. Much of what I found was useless. But one posting had the answer close enough. The config information I posted is correct and it works. I'm not sure what finally got the problem resolved. Maybe the cold beer worked.
Thanks for your help. Now that I have the database created and can connect I will try to use it in another project. Now I will try to find a way to get the website admin tool to work in VS 2013! I am using VS 2010 where I encountered the MySql difficulties.
这篇关于Mysql会员/角色提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!